Internal implementation detail of Hoodoo::Communicators::Pool which is placed on a Ruby Queue and used as part of thread processing for slow communicators.

Methods
D
N
S
T
Attributes
[RW] dropped

If not nil or zero, the number of dropped messages that should be send to the slow communicator subclass's dropped method. See also dropped?

[RW] payload

If the entry represents neither a termination request nor a dropped message count (see terminate? and dropped?), the payload to send to the slow communicator subclass's communicate method.

[RW] sync

If true, the processing Thread should push one item with any payload onto its sync Queue. See also sync?

[RW] terminate

If true, the processing Thread should exit. See also terminate?.

Class Public methods
new( payload: nil, dropped: nil, terminate: false, sync: false )

Create a new instance, ready to be added to the Queue.

ONLY USE ONE of the named parameters:

payload

A parameter to send to communicate in the communicator.

dropped

The integer to send to dropped in the communicator.

terminate

Set to true to exit the processing thread when the entry is read from the Queue.

sync

Set to true to push a message onto the sync Queue.

# File lib/hoodoo/communicators/pool.rb, line 571
def initialize( payload: nil, dropped: nil, terminate: false, sync: false )
  @payload   = payload
  @dropped   = dropped
  @terminate = terminate
  @sync      = sync
end
Instance Public methods
dropped?()

Returns true if this queue entry represents a dropped message count (see dropped), else +false (see terminate? then payload).

# File lib/hoodoo/communicators/pool.rb, line 595
def dropped?
  @dropped != nil && @dropped > 0
end
sync?()

Returns true if this queue entry represents a request to push a message onto the processing Thread's sync Queue.

# File lib/hoodoo/communicators/pool.rb, line 588
def sync?
  @sync == true
end
terminate?()

Returns true if encountering this queue entry should terminate the processing thread, else false (see dropped? then payload).

# File lib/hoodoo/communicators/pool.rb, line 581
def terminate?
  @terminate == true
end