openpectus.engine.engine_message_handlers

Attributes

logger

Classes

EngineDispatcherRpcHandler

Base class for protocol classes.

EngineMessageHandlers

Module Contents

openpectus.engine.engine_message_handlers.logger
class openpectus.engine.engine_message_handlers.EngineDispatcherRpcHandler

Bases: Protocol

Base class for protocol classes.

Protocol classes are defined as:

class Proto(Protocol):
    def meth(self) -> int:
        ...

Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing).

For example:

class C:
    def meth(self) -> int:
        return 0

def func(x: Proto) -> int:
    return x.meth()

func(C())  # Passes static type check

See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:

class GenProto(Protocol[T]):
    def meth(self) -> T:
        ...
abstract set_rpc_handler(message_type, handler)
Parameters:
class openpectus.engine.engine_message_handlers.EngineMessageHandlers(engine, dispatcher)
Parameters:
engine
__str__()
Return type:

str

async handle_methodMsg(msg)
Parameters:

msg (openpectus.protocol.aggregator_messages.AggregatorMessage)

async handle_executeControlCommandMsg(msg)
Parameters:

msg (openpectus.protocol.aggregator_messages.AggregatorMessage)

Return type:

openpectus.protocol.messages.MessageBase

async handle_injectCodeMsg(msg)
Parameters:

msg (openpectus.protocol.aggregator_messages.AggregatorMessage)

Return type:

openpectus.protocol.messages.MessageBase

async handle_cancelMsg(msg)
Parameters:

msg (openpectus.protocol.aggregator_messages.AggregatorMessage)

Return type:

openpectus.protocol.messages.MessageBase

async handle_forceMsg(msg)
Parameters:

msg (openpectus.protocol.aggregator_messages.AggregatorMessage)

Return type:

openpectus.protocol.messages.MessageBase