class Hoodoo::Communicators::Pool::QueueEntry
Internal implementation detail of Hoodoo::Communicators::Pool
which is placed on a Ruby Queue and used as part of thread processing for slow communicators.
Attributes
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.
If true
, the processing Thread should push one item with any payload onto its sync Queue. See also sync?
If true
, the processing Thread should exit. See also terminate?
.
Public Class Methods
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 579 def initialize( payload: nil, dropped: nil, terminate: false, sync: false ) @payload = payload @dropped = dropped @terminate = terminate @sync = sync end
Public Instance Methods
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 603 def dropped? @dropped != nil && @dropped > 0 end
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 596 def sync? @sync == true end