Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

MessageConsumer Class Reference

Inheritance diagram for MessageConsumer:

BulletinConsumer List of all members.

Public Member Functions

 this (Cluster cluster, IEvent event)
protected void invoke (IEvent event, IPayload payload)

Private Member Functions

 this (ISocketReader reader, IBuffer buffer)
void notify (IBuffer buffer)
Cluster getCluster ()
void pauseGroup ()
void resumeGroup ()
void cancel ()

Detailed Description

A listener for queue events. These events are produced by the queue host on a periodic bases when it has available entries. We listen for them (rather than constantly scanning) and then begin a sweep to process as many as we can. Note that we will be in competition with other nodes to process these entries.

Definition at line 607 of file Cluster.d.


Member Function Documentation

this Cluster  cluster,
IEvent  event
[inline]
 

Construct a multicast consumer for the specified event

Reimplemented from BulletinConsumer.

Definition at line 615 of file Cluster.d.

protected void invoke IEvent  event,
IPayload  payload
[inline]
 

override the default processing to sweep the cluster for queued entries. Each server node is queried until one is found that contains a payload. Note that it is possible to set things up where we are told exactly which node to go to; howerver given that we won't be listening whilst scanning, and that there's likely to be a group of new entries in the cluster, it's just as effective to scan. This will be far from ideal for all environments, so we should make the strategy plugable instead.

Reimplemented from BulletinConsumer.

Definition at line 645 of file Cluster.d.

References IEvent::getChannel(), Cluster::getQueue(), IEvent::invoke(), BulletinConsumer::pauseGroup(), and BulletinConsumer::resumeGroup().

this ISocketReader  reader,
IBuffer  buffer
[inline, inherited]
 

Construct a listener with the requisite arguments. The specified buffer is populated via the provided instance of ISocketReader before being passed to the notify() method. All arguments are required.

Definition at line 81 of file SocketListener.d.

void notify IBuffer  buffer  )  [inline, inherited]
 

Notification callback invoked when we receive a multicast packet. Note that we check the packet channel-name against the one we're consuming, to check for cases where the group address had a hash collision.

Reimplemented from SocketListener.

Definition at line 508 of file Cluster.d.

References BulletinConsumer::event, IEvent::getChannel(), IChannel::getName(), ProtocolReader::getPayload(), and BulletinConsumer::invoke().

Cluster getCluster  )  [inline, inherited]
 

Return the cluster instance we're associated with.

Definition at line 550 of file Cluster.d.

void pauseGroup  )  [inline, inherited]
 

Temporarily halt listening. This can be used to ignore multicast messages while, for example, the consumer is busy doing other things.

Definition at line 563 of file Cluster.d.

References MulticastSocket::pauseGroup().

Referenced by invoke().

void resumeGroup  )  [inline, inherited]
 

Resume listening, post-pause.

Definition at line 574 of file Cluster.d.

References MulticastSocket::resumeGroup().

Referenced by invoke().

void cancel  )  [inline, inherited]
 

Cancel this consumer. The listener is effectively disabled from this point forward. The listener thread does not halt at this point, but waits until the socket-read returns. Note that the D Interface implementation requires us to "reimplement and dispatch" trivial things like this ~ it's a pain in the neck to maintain.

Reimplemented from IConsumer.

Definition at line 590 of file Cluster.d.


The documentation for this class was generated from the following file:
Generated on Sun Nov 7 19:07:07 2004 for Mango by doxygen 1.3.6