Channel Processors used to construct conceptual Flows.
A Channel represents an individual segment in a conceptual Flow. Channels connect together like UNIX pipes, but transfer typed messages (objects) instead of just data.
sys
collections0
functools0
weakref0
typing0
queue0
core0
Event0
Signal objects used to communicate flow control operations for subflow management. These objects are used by Catenation and Division to index operations.
Event__slots__0
__slots__ = ()
Event__int__0
__int__(self)
Event__repr__0
__repr__(self)
Event__str__0
__str__(self)
fe_initiate0
fe_initiate = Event()
fe_clear0
fe_clear = Event()
fe_transfer0
fe_transfer = Event()
fe_obstruct0
fe_obstruct = Event()
fe_terminate0
fe_terminate = Event()
flow_events0
flow_events = (
fe_terminate,
fe_obstruct,
fe_transfer,
fe_clear,
fe_initiate,
)
Channel0
A Processor consisting of an arbitrary set of operations that can connect to other Channel instances in order to make a series of transformations.
Channels are the primary mechanism used to stream events; generally, anything that's a stream should be managed by Channel instances in favor of other event callback mechanisms.
ChannelProperties
- f_type
The flow type describing what the instance does. This property can be None at the class level, but should be initialized when an instance is created.
switchChannel that takes events and distributes their transformation to a mapping of receiving flows.
transformerChannel emits events strictly in response to processing. Transformers may buffer events as needed.
- None
Unspecified type.
- f_obstructions
- None
No obstructions present.
- typing.Mapping
The objects that are obstructing the Channel from performing processing associated with the exact condition causing it.
- f_monitors
The set of callbacks used to signal changes in the flow's f_obstructed state.
- None
No monitors watching the flow state.
- f_downstream
The Channel instance that receives events emitted by the instance holding the attribute.
Channelf_type
f_type = None
Channelf_obstructions
f_obstructions = None
Channelf_monitors
f_monitors = None
Channelf_downstream
f_downstream = None
Channelf_upstream
f_upstream = None
Channelf_connect185%
f_connect(self, flow)
Connect the Channel to the given object supporting the Flow interface. Normally used with other Channels, but other objects may be connected.
Downstream is not notified of upstream obstructions. Events run downstream and obstructions run up.
Channelf_disconnect50%
f_disconnect(self)
Disconnect from the downstream and cease emitting events into f_downstream.
Channelf_collapse90%
f_collapse(self)
Connect the upstream to the downstream leaving the Channel self in a disconnected state with the old references remaining in place.
Channelf_substitute40%
f_substitute(self, series)
Channel__repr__10%
__repr__(self)
Channelstructure40%
structure(self)
Reveal the obstructions and monitors of the Channel.
Channelterminate0
terminate(self)
Drain the Channel and finish termination by signalling the controller of its exit.
Channelf_terminate0
f_terminate(self)
Termination signal received when the upstream no longer has flow transfers for the downstream Channel.
Channel_f_terminated0
_f_terminated(self)
Used by subclasses to issue downstream termination and exit.
Subclasses must call this or perform equivalent actions when termination of the conceptual flow is complete.
Channelinterrupt0
interrupt(self)
Channelf_transfer0
f_transfer(self, event)
Emit the event directly to the downstream.
Channelf_emit0
f_emit(self, event)
Method replaced at runtime for selecting the recipient of a processed event.
Channelf_empty10%
Whether the flow is actively performing a transfer.
This property returns True in cases where the Channel's state is such that it may independently send events downstream.
Channels that have buffers should implement this method.
Channelf_obstructed0
Whether or not the Channel is obstructed.
Channelf_permanent420%int
Whether or not there are Inexorable obstructions present. An integer specifying the number of Inexorable obstructions or None if there are no obstructions.
Channelf_obstruct0
f_obstruct(self, by)
Instruct the Channel to signal the cessation of transfers. The cessation may be permanent depending on the condition.
Channelf_clear0
f_clear(self, obstruction)
Clear the obstruction by the key given to obstruction.
Channelf_watch0
f_watch(self, obstructed, cleared)
Assign the given functions as callbacks to obstruction events. First called when an obstruction occurs and second when its cleared.
Channelf_ignore0
f_ignore(self, obstructed, cleared)
Stop watching the Flow's obstructed state.
Channelf_discarding0
f_discarding(self)
Assigned to process and f_emit after termination and interrupt in order to keep overruns from exercising the Transformations.
Dispatch0
Channel dispatching events to the configured callable.
Dispatch__init__10%
__init__(self, endpoint)
Dispatchf_transfer20%
f_transfer(self, event)
Terminal0
Transparent channel that performs a callback when termination is received from the upstream channel.
Used as an at-exit callback for flows.
Terminal__init__0
__init__(self, endpoint)
Terminalf_terminate0
f_terminate(self)
Monitor0
Terminal measuring transfer throughput.
Monitoractuate60%
actuate(self)
Monitorf_transfer20%
f_transfer(self, event)
Monitortm_start10%
Monitortm_archive170%
tm_archive(self, pit)
Archive transfer data occurring before pit.
Monitortm_rate90%
tm_rate(self, window)
Relay0
Relay intersector transfers.
Initialized with the set of events that will be relayed, fe_transfer, fe_terminate, and fe_interrupt.
Relay__init__0
__init__(self, integral, key)
Relayf_transfer0
f_transfer(self, event)
Relayf_terminate0
f_terminate(self)
Relayinterrupt0
interrupt(self)
Receiver0
Receive intersector transfers.
A simple Channel expecting to receive events from a remote Relay
Receiverf_type0
f_type = 'source'
Receiver_r_connect
_r_connect = None
Receiver__init__0
__init__(self, connect)
Receiverf_transfer0
f_transfer(self, events)
Receiverint_transfer0
int_transfer(self, key, event)
Receiverint_terminate0
int_terminate(self, key)
Transformation0
A flow that performs a transformation on the received events.
Transformationf_type0
f_type = 'transformer'
Transformation__init__0
__init__(self, transform)
Transformationf_transfer0
f_transfer(self, event)
Iteration0
Channel that emits the contents of an collections.abc.Iterator until an obstruction occurs or the iterator ends.
Iterationf_type0
f_type = 'source'
Iterationf_clear0bool
f_clear(self, *args)
Override of Channel.f_clear that enqueues an it_transition call if it's no longer obstructed.
Iterationit_transition0
it_transition(self)
Emit the next item in the iterator until an obstruction occurs or the iterator is exhausted.
Iteration__init__0
__init__(self, iterator)
Iteration__init__Parameters
Iterationactuate0
actuate(self)
Iterationf_transfer20%
f_transfer(self, it)
Raises exception as Iteration is a source.
Collection0
Terminal Channel collecting the events into a buffer for processing after termination.
Collectionf_type0
f_type = 'terminal'
Collection__init__0
__init__(self, storage, operation)
Collectionappended_list0
appended_list(Class)
Construct a Collection instance that appends all events into a list.
Collectionlist0
list = appended_list
@classmethod
Collectionextended_list30%
extended_list(Class)
Construct a Collection instance that extends all events into a list.
Collectiondict0
dict(Class)
Construct a Collection instance that builds the contents of a mapping from sequences of key-value pairs.
Collectionset0
set(Class)
Collection_buffer_operation0
_buffer_operation(event)
Collectionbuffer0
buffer(Class)
Construct a Collection instance that accumulates data from sequences of data into a single bytearray.
Collectionf_transfer0
f_transfer(self, obj)
Parallel0
A dedicated thread for processing events emitted to the Flow.
The requisite function should have the following signature:
def thread_function(transformer, queue, *optional):
...
The queue provides access to the events that were received by the Transformer, and the transformer argument allows the thread to cause obstructions by accessing its controller.
Parallel__init__40%
__init__(self, target, *parameters)
Parallelterminate40%
terminate(self)
Initiate termination of the thread.
Paralleltrap60%
trap(self)
Internal; Trap exceptions in order to map them to faults.
Parallelf_transfer20%
f_transfer(self, event)
Send the event to the queue that the Thread is connected to. Injections performed by the thread will be enqueued into the main task queue.
Parallelactuate20%
actuate(self)
Execute the dedicated thread for the transformer.
Protocol0
Protocol class for containing the state of a protocol layer.
Protocol__init__0
__init__(self, shared, local, transfer)
Protocolf_transfer0
f_transfer(self, event)
Protocolp_terminated20%
p_terminated(self)
Called when the internal protocol state has completed termination.
Defaults to Channel.f_terminate but overridden in cases where synchronization needs to occur with a corresponding Protocol channel.
Protocolp_drain0
p_drain(self)
Perform an empty transfer allowing any transmit buffers to be emptied.
Catenation0
Sequence a set of flows in the enqueued order.
Emulates parallel operation by facilitating the sequenced delivery of a sequence of flows where the first flow is carried until completion before the following flow may be processed.
Essentially, this is a buffer array that uses Flow termination signals to manage the current working flow and queues to buffer the events to be emitted when next is promoted.
CatenationEngineering
CatenationProperties
Catenationf_type0
f_type = 'join'
Catenation__init__0
__init__(self)
Catenationcat_overflowing0
cat_overflowing(self, channel_id)
Whether the given flow's queue has too many items.
Catenationint_transfer191%
int_transfer(self, channel_id, events)
Emit point for Sequenced Flows
Catenationint_connect0
int_connect(self, channel_id, initiate, flow)
Connect the flow to the channel_id using the initiate parameter.
Catenationint_reserve0
int_reserve(self, *channel_id)
Reserve a position in the sequencing of the flows. The given initiate is the reference object used by int_connect in order to actually connect flows.
Catenationf_transfer187%
f_transfer(self, events)
Transparency support allowing Division to be directly connected. Usually unused.
Catenationint_terminate340%
int_terminate(self, channel_id)
Catenationf_terminate0
f_terminate(self)
Catenationterminate10%
terminate(self)
Termination signal ignored. Flow state dictates terminal state.
Catenationcat_flush0
cat_flush(self)
Flush the accumulated events downstream.
Catenationcat_drain193%
cat_drain(self)
Drain the new head of line emitting any queued events and updating its entry in cat_connections to immediately send events.
Catenationcat_transition191%
cat_transition(self)
Move the first enqueued flow to the front of the line; flush out the buffer and remove ourselves as an obstruction.
Division0
Coordination of the routing of a protocol's content.
Protocols consisting of a series of requests, HTTP for instance, need to control where the content of a request goes. QueueProtocolInput manages the connections to actual Flow instances that delivers the transformed application level events.
Divisionf_type0
f_type = 'fork'
Division__init__0
__init__(self, dispatch)
Divisionf_transfer0
f_transfer(self, events)
Direct the given events to their corresponding action in order to map protocol stream events to Flow instances.
Divisioninterrupt50%
interrupt(self)
Interruptions on distributions translates to termination.
Divisionf_terminate362%
f_terminate(self)
Divisiondiv_initiate0
div_initiate(self, f_event, channel_id, initiate)
Initiate a subflow using the given channel_id as its identity. The channel_id along with a callable performing div_connect will be emitted to the Flow.f_connect downstream.
Divisiondiv_connect1060%
div_connect(self, channel_id, flow)
Associate the flow with the channel_id allowing transfers into the flow.
Drains the queue that was collecting events associated with the channel_id, and feeds them into the flow before destroying the queue. Layer connections without queues are the head of the line, and actively receiving transfers and control events.
Divisiondiv_transfer180%
div_transfer(self, f_event, channel_id, subflow_transfer)
Enqueue or transfer the events to the flow associated with the channel_id context.
Divisiondiv_terminate283%
div_terminate(self, f_event, channel_id, terminal)
End of subflow.
Divisiondiv_operations0
div_operations = {
fe_initiate: div_initiate,
fe_terminate: div_terminate,
fe_obstruct: None,
fe_clear: None,
fe_transfer: div_transfer,
}