# Class: Concurrent::Channel::Buffer::Timer

Inherits:
  Base
  - Object
  - Synchronization::LockableObject
  - Base
  - Concurrent::Channel::Buffer::Timer
  show all

Defined in:
  lib-edge/concurrent/channel/buffer/timer.rb

## Direct Known Subclasses

Ticker

## Instance Method Summary collapse

- #next ⇒ undocumented
- #offer(item) ⇒ undocumented
- #poll ⇒ undocumented
- #put(item) ⇒ undocumented
- #take ⇒ undocumented

## Constructor Details

This class inherits a constructor from Concurrent::Channel::Buffer::Base

## Instance Method Details

### #next ⇒ `undocumented`

    31
    32
    33
    34
    35
    36
    37

    # File 'lib-edge/concurrent/channel/buffer/timer.rb', line 31

    def next
      loop do
        tick, more = do_poll
        return tick, more if tick
        Thread.pass
      end
    end

### #offer(item) ⇒ `undocumented`

    16
    17
    18

    # File 'lib-edge/concurrent/channel/buffer/timer.rb', line 16

    def offer(item)
      false
    end

### #poll ⇒ `undocumented`

    39
    40
    41
    42
    43

    # File 'lib-edge/concurrent/channel/buffer/timer.rb', line 39

    def poll
      tick, _ = do_poll
      tick = Concurrent::NULL unless tick
      tick
    end

### #put(item) ⇒ `undocumented`

    12
    13
    14

    # File 'lib-edge/concurrent/channel/buffer/timer.rb', line 12

    def put(item)
      false
    end

### #take ⇒ `undocumented`

    20
    21
    22
    23
    24
    25
    26
    27
    28
    29

    # File 'lib-edge/concurrent/channel/buffer/timer.rb', line 20

    def take
      loop do
        tick, _ = do_poll
        if tick
          return tick
        else
          Thread.pass
        end
      end
    end