Core data types and classes.
typing
functools0
builtins0
operator0
weakref0
collections0
itertools0
traceback0
heapq0
weak0
set_actuated0
set_actuated(processor)
set_terminated20%
set_terminated(processor)
Join0
An object whose purpose is to join the completion of multiple processors into a single event. Joins are used to simplify coroutines whose progression depends on a set of processors instead of one.
Joins also enable interrupts to trigger completion events so that failures from unrelated Sectors can be communicated to callback.
JoinProperties
- dependencies
The original set of processors as a dictionary mapping given names to the corresponding Processor.
Join__slots__0
__slots__ = ('dependencies', 'pending', 'callback')
Join__init__0
__init__(self, **processors)
Initialize the join with the given processor set.
Joinconnect0
connect(self)
Connect the Processor.atexit calls of the configured dependencies to the Join instance.
Join__iter__0
__iter__(self)
Return an iterator to the configured dependencies.
Join__getitem__0
__getitem__(self, k)
Get the dependency the given identifier.
Joinexited0
exited(self, processor)
Record the exit of the given processor and execute the callback of the Join if the processor is the last in the configured pending set.
Joinatexit0
atexit(self, callback)
Assign the callback of the Join.
If the pending set is empty, the callback will be immediately executed, otherwise, overwrite the currently configured callback.
The callback is executed with the Join instance as its sole parameter.
JoinatexitParameters
Condition0
A reference to a logical expression or logical function.
Conditional references are constructed from a subject object, attribute path, and parameters. Used to clearly describe the objects that participate in a logical conclusion of interest.
Used by Flow instances to describe the condition in which an obstruction is removed. Conditions provide introspecting utilities the capacity to identify the cause of an obstruction.
Condition__slots__0
__slots__ = ('focus', 'path', 'parameter')
Condition__init__0
__init__(self, focus, path, parameter)
Condition__init__Parameters
Condition__bool__0
__bool__(self)
Condition__repr__50%
__repr__(self)
Conditionattribute0
attribute(self)
Inexorable0
Inexorable = Condition(builtins, ('False',))
ExceptionStructure0
Exception associated with an interface supporting the sequencing of processor trees.
ExceptionStructureactuated
actuated=True
ExceptionStructureterminated
terminated=False
ExceptionStructureinterrupted
interrupted=False
ExceptionStructure__init__20%
__init__(self, identity, exception)
ExceptionStructure__getitem__10%
__getitem__(self, k)
ExceptionStructurestructure50%
structure(self)
Processor0
A resource that maintains an arbitrary state.
State Transition Sequence.
Instantiated
Actuated
Functioning
Terminating
Terminated
Where the functioning state designates that the implementation specific state has been engaged. Often, actuation and termination intersect with implementation states.
The interrupted state is special; its used as a frozen state of the machine and is normally associated with an exception. The term interrupt is used as it is nearly analogous with UNIX process interrupts SIGINT.
Processor_unset_sector
_unset_sector(self)
Processor_sector_reference0
_sector_reference = _unset_sector
Processor_invert_sector_reference20%
_invert_sector_reference(self)
Processor_dereference_sector0
_dereference_sector(self)
Processor_set_sector_reference0
_set_sector_reference(self, obj)
Processorsector0
sector = controller = property(
fget = _dereference_sector,
fset = _set_sector_reference,
doc = "The managing processor."
)
Processorcontrollerstack70%
controllerstack(self)
Return the full sector stacks of the processor.
Processor__repr__40%
__repr__(self)
Processor_pexe_state
_pexe_state = 0 # defaults to "object initialized"
Processor_pexe_states0
_pexe_states = (
('initialized', 0), # Created.
('actuated', 1), # Placed in Execution Context and started.
('terminating', 2), # Received and accepted termination request.
('terminated', -1), # Termination completed and the processor will exit().
('deallocating', 0), # Unused state.
)
Processor_pexe_contexts0
_pexe_contexts = ()
@property
Processoractuated233%bool
Whether the processor has been actuated, normally within a Sector.
Processorterminating0bool
Whether the processor has started terminate.
Processorterminated0bool
Whether the processor has been terminated.
Processorstatus10%
Processorinterrupted0typing.Union[bool]
Processorexceptions
exceptions = None
@property
Processorfunctioning0
Whether or not the Processor is functioning. Indicates that the processor was actuated and is neither terminated nor interrupted.
| NOTE | |
Processors are functioning during termination; instances where |
Processoractuate0
actuate(self)
Initialize the Processor for use within the controlling Sector.
Initialization method called after a Processor has been given execution context. Processor.actuate performs no actions and does not need to be called when overridden.
Processorstart_termination
start_termination(self)
Processorfinish_termination0
finish_termination(self)
Processorterminate0
terminate(self)
Terminate the Processor using interrupt and exit.
Processorinterrupt0
interrupt(self)
Signal the Processor that the controlling Sector has been interrupted, and all processing of events should cease immediately.
Subclasses that need to perform disconnects or cancellations should implement this method in order to ensure that event processing stops. However, interrupt procedures will automatically rewrite the process method to perform a no-op if invoked, so carefully written subclasses may not have to perform any tasks at all.
Processorfault0
fault(self, exception)
Note the given exception as an error on the Processor. Exceptions identified as errors cause the Processor to exit.
Called internally when a task associated with a Processor raises an exception. The controlling Sector will be interrupted and the faulting Processor identified for subsequent scrutiny.
Processortrap0
trap(self, task)
Processorcritical0
critical(self, task)
Enqueue a task associated with the sector so that exceptions cause the sector to fault. This is the appropriate way for Processor instances controlled by a sector to sequence processing.
Processorexit0
exit(self)
Exit the processor by signalling the controlling processor that termination has completed.
Processorstructure70%
structure(self)
Provides the structure stack with at-exit callbacks.
Processorplacement0
placement(self)
Define the set index to use when dispatched by a Sector.
By default, Sector instances place Processor instances into set objects that stored inside a dictionary. The index used for placement is allowed to be overridden in order to optimize the groups and allow better runtime introspection.
Processorsubstitute20%
substitute(self, processor)
Terminate the processor self, but reassign the exit hooks to be performed when the given processor exits. processor will be dispatched into the controlling sector.
Sector0
A processing sector; manages a set of Processor resources according to their class. Termination of a Sector is solely dependent whether or not there are any Processor instances within the Sector.
Sectors are the primary Processor class and have protocols for managing projections of entities (users) and their authorizing credentials.
SectorProperties
- processors
A divided set of abstract processors currently running within a sector. The sets are divided by their type inside a collections.defaultdict.
- exits
Set of Processors that are currently exiting. None if nothing is currently exiting.
Sectorexits
exits = None
Sectorprocessors
processors = None
Sector_sector_interrupted
_sector_interrupted = False
@property
Sectorinterrupted0
Sectoriterprocessors0
iterprocessors(self)
Sectorstructure30%
structure(self)
Sector__init__0
__init__(self, *processors)
Sectoractuate280%
actuate(self)
Actuate the Sector by actuating its processors. There is no guarantee to the order in which the controlled processors are actuated.
Exceptions that occur during actuation fault the Sector causing the controlling sector to exit. If faults should not cause the parent to be interrupted, they must be dispatched after self has been actuated.
Sector_sector_terminated0
_sector_terminated = Processor.exit
Sectorterminate60%
terminate(self)
Sectorinterrupt185%
interrupt(self)
Interrupt the Sector by interrupting all of the subprocessors. The order of interruption is random, and should be insignificant.
Sectorexited271%
exited(self, processor)
Sector structure exit handler.
Called when a Processor has reached termination and should no longer be contained within the Sector.
Sectordispatch0
dispatch(self, processor)
Dispatch the given processor inside the Sector.
Returns the given processor.
Sector_flow60%
_flow(self, series)
Sectorreap0
reap(self)
Empty the exit set and check for sector completion.
Sectorreaped0
reaped(self)
Called once the set of exited processors has been reaped in order to identify if the Sector should notify the controlling Sector of an exit event..
Sectorplacement40%
placement(self)
Use Interface.if_sector_placement if the sector has an Interface. Otherwise, Sector.
Context0
The base class for Transaction Context processors.
Subclasses define the initialization process of a Transaction and the structures used to provide depending processors with the necessary information for performing their tasks.
ContextNamespaces
Context Processors employ two hard namespaces in its methods. The xact_ctx_ and the xact_. Methods and properties that exist under xact_ctx_ refer to generic Context operations whereas xact_ refers to operations that primary effect the Transaction sector containing the context.
Contextplacement0
placement(self)
Contextrequire10%
require(self, identifier)
Contextprovide0
provide(self, identifier)
Export self as a named context inherited by all descending processors.
Contextxact_empty0bool
xact_empty(self)
Whether the Transaction has any processors aside from the Context.
Contextxact_exit_if_empty0
xact_exit_if_empty(self)
Check for processors other than self, if there are none, exit the transaction.
Contextxact_contextstack712%typing.Iterable[Processor]
xact_contextstack(self)
The complete context stack of the Transaction excluding self. First entry is nearest to self; last is furthest ascent.
Contextxact_subxacts10%
Contextxact_dispatch0
xact_dispatch(self, processor)
Dispatch the given processor into the Transaction.
Contextxact_initialized20%
xact_initialized(self)
Called when the Transaction Context has been fully initialized with respect to the proposed event set determined by actuation.
Contextxact_exit0
xact_exit(self, xact)
Subtransaction xact exited.
Contextxact_void20%
xact_void(self, xact)
All subtransactions exited; xact was final. Defaults to termination of the context and transaction exit.
Contextinterrupt0
interrupt(self)
Update Transaction Context callbacks to null operations.
Sets interrupted to True and should be called by subclasses if overridden.
Transaction0
A Sector with Execution Context.
Transactions are sectors with a single Context instance that is used to manage the state of the Sector. Regular Sectors exit when all the processors are shutdown, and Transactions do too. However, the Context is the controlling processor and must be the last to exit.
TransactionProperties
- xact_context
The Processor that will be dispatched to initialize the Transaction Sector and control its effect. Also, the receiver of Processor.terminate.
Transactioncreate0
create(Class, xc)
Create a Transaction sector with the given Context initializaed as the first Processor to be actuated.
This is the appropriate way to instantiate Transaction instances
Transactionisinstance20%
isinstance(self, ContextClass)
Whether the Transaction's context, xact_context, is an instance of the given ContextClass.
Transactionterminate0
terminate(self)
Invoke the Context.terminate method of the xact_context property. The termination of the Transaction is managed entirely by the Context.
Transactionplacement0
placement(self)
Define the set index to use when dispatched by a Sector.
By default, Sector instances place Processor instances into set objects that stored inside a dictionary. The index used for placement is allowed to be overridden in order to optimize the groups and allow better runtime introspection.
Transactionsubtransactions0
The set of subtransactions currently running.
Transactioniterprocesses20%
iterprocesses()
Transactionexited0
exited(self, processor)
Executable0
Transaction sequence created from an invocation.
ExecutableProperties
- exe_identifier
A, usually, unique identifier for the executable. The transaction context that the executable is dispatched within determines any constraints, if any.
- exe_faults
The set of sectors that were faulted within the context; usually keyed by the identifier of the processor that was blamed.
- exe_faults_count
The total number of faults that occurred. In cases where faults have been purged from exe_faults, the count allows recognition of the purge.
Executable__init__183%
__init__(self, invocation)
Executableactuate0
actuate(self)
Executableterminate50%
terminate(self)
Executablexact_void183%
xact_void(self, final)
Consume the next transaction in the queue.
Executableexe_enqueue0
exe_enqueue(self, xact_context)
Executableexe_initialize0
exe_initialize(self)
Execute the enqueued transaction or cause the executable to exit.
Executablefaulted80%None
faulted(self, proc)
Place the sector into the faults directory using the hex identifier as its name.
Executablestructure20%
structure(self)
Sequenced0
Transaction sequence created from a predefined sequence of Context instances.
Subtransactions are dispatched in order and terminated in reverse order.
Sequenced__init__10%
__init__(self, contexts)
Sequencedactuate30%
actuate(self)
Sequencedxact_exit70%
xact_exit(self, xact)
Sequencedxact_void10%
xact_void(self, final)
Sequencedterminate30%
terminate(self)