things.thinger.io.conduits
Interface PullDrain

All Known Subinterfaces:
PullDrainContainer
All Known Implementing Classes:
BasicPullDrainContainer

public interface PullDrain

A Conduit drain interface for a poller. The poll and wait calls are thread safe and may be run outside any Conduit thread context. Depending on the injector's registered, they may wait for this drain to continue, so please be careful not to spend too much time away from the poll or wait.

You will not register your own implementation of this with the Conduit. Instead, register a PullDrainContainer.

Version:
1.0

Version History

EPG - Adapted from autohit - 29 JUN 05
 
Author:
Erich P. Gatejen

Method Summary
 void init(ConduitID yourId)
          Initialize the PullDrain.
 Data poll()
          Poll for an item.
 Data waitItem()
          Wait for an item.
 

Method Detail

init

void init(ConduitID yourId)
          throws SystemException
Initialize the PullDrain. This will be called by it's controller. An subsequent calls may result in a PANIC SystemException. Don't do it!

Parameters:
yourId - The ConduitID for this PullDrain.
Throws:
SystemException
See Also:
ConduitID

poll

Data poll()
          throws SystemException
Poll for an item. It will return the item or null if it isn't there.

Returns:
a data or null if nothing is there.
Throws:
SystemException
See Also:
Data

waitItem

Data waitItem()
              throws SystemException
Wait for an item. It will block until there is an item, when it will return it. However, it is possible that a ThingsException could interupt the block due to a FAULT.

Returns:
a data or null if nothing is there.
Throws:
SystemException
See Also:
Data


Things.