tubes.itube.IFount(Interface)
interface documentationtubes.itube
(View In Hierarchy)
Known implementations: tubes._siphon._SiphonFount, tubes.fan._InFount, tubes.fan._OutFount, tubes.protocol._FountImpl, tubes.protocol._TransportFount, tubes.tube._NullFount
A fount produces objects for a drain to consume.
Attribute | outputType | The type of output produced by this Fount. |
Attribute | drain | The IDrain currently
accepting input from this IFount . (Read-only; should
raise AttributeError
if set.) |
Method | flowTo | Add a drain to this fount to consume its output. |
Method | pauseFlow | Temporarily refrain from delivery of items to this IFount 's drain
attribute. |
Method | stopFlow | No summary |
The IDrain
currently
accepting input from this IFount
. (Read-only; should
raise AttributeError
if set.)
Add a drain to this fount to consume its output.
This will synchronously call flowingFrom(fount)
on drain
to indicate to drain
which IFount
its future input
will come from - unless this IFount
is exhausted and
will never produce more output. In this case, flowTo
must
not call flowingFrom
, and must return None
.
Typically, this will return the result of drain.flowingFrom(fount)
to allow construction of pipelines with the
x.flowTo(...).flowTo(...).flowTo(...)
idiom; however,
implementations of IFount
are at liberty to
return None
or any valid IFount
.
Returns | another IFount provider,
or None . By convention, this will return the value of
flowingFrom and allow the drain to transform the
outputType (however, other transformations are allowed). | |
Raises | AlreadyDraining | if there is already a drain (i.e. flowTo has already been
called on this IFount .) |
Temporarily refrain from delivery of items to this IFount
's drain
attribute.
Returns | a pause token which may
be used to remove the impediment to this IFount 's flow established
by this call to pauseFlow . Multiple calls will result in
multiple tokens, all of which must be unpaused for the flow to resume. (type: IPause ) |
End the flow from this IFount
; after this
invocation, this IFount
should never call any methods on its drain
other than self.drain.flowStopped()
.
It will invoke flowStopped
once, when the resources associated
with this IFount
flowing
have been released.