missive package

Submodules

missive.messages module

class missive.messages.DictMessage(raw_data: bytes, decoder: Callable[[bytes], Dict[Any, Any]])

Bases: missive.missive.Message

contents() → Dict[Any, Any]

missive.missive module

class missive.missive.Adapter(processor: missive.missive.Processor[~M][M])

Bases: typing.Generic

Abstract base class representing the API between missive.Processor and adapters.

ack(message: M) → None

Mark a message as acknowledged.

Parameters:message – The message object to be acknowledged.
nack(message: M) → None

Mark a message as negatively acknowledged.

The meaning of this can vary depending on the message transport in question but generally it either returns the message to the message bus queue from which it came or triggers some special processing via some (message bus specific) dead letter queue.

Parameters:message – The message object to be acknowledged.
class missive.missive.HandlingContext(message: M, processing_ctx: missive.missive.ProcessingContext[~M][M])

Bases: typing.Generic

ack() → None
nack() → None
class missive.missive.JSONMessage(raw_data: bytes)

Bases: missive.missive.Message

get_json() → Any
class missive.missive.Message(raw_data: bytes)

Bases: object

class missive.missive.ProcessingContext(message_cls: Type[M], adapter: missive.missive.Adapter[~M][M], processor: missive.missive.Processor[~M][M])

Bases: typing.Generic

ack(message: M) → None
handle(message: M) → None
handling_context(message: M) → Iterator[missive.missive.HandlingContext[~M][M]]

Enter the handling context, including calling hooks.

nack(message: M) → None
class missive.missive.Processor

Bases: typing.Generic

after_handling(hook: Callable[[missive.missive.ProcessingContext[~M][M], missive.missive.HandlingContext[~M][M]], None]) → None
after_processing(hook: Callable[[missive.missive.ProcessingContext[~M][M]], None]) → None
before_handling(hook: Callable[[missive.missive.ProcessingContext[~M][M], missive.missive.HandlingContext[~M][M]], None]) → None
before_processing(hook: Callable[[missive.missive.ProcessingContext[~M][M]], None]) → None
context(message_cls: Type[M], adapter: missive.missive.Adapter[~M][M]) → Iterator[missive.missive.ProcessingContext[~M][M]]

Enter the processing context, including calling hooks.

handle_for(matcher: Callable[[M], bool]) → Callable[[Callable[[M, missive.missive.HandlingContext[~M][M]], None]], None]
set_dlq(dlq: MutableMapping[bytes, Tuple[M, str]]) → None
test_client() → Iterator[missive.missive.TestAdapter[~M][M]]
class missive.missive.ProcessorHooks(*args, **kwds)

Bases: typing.Generic

class missive.missive.RawMessage(raw_data: bytes)

Bases: missive.missive.Message

A raw message of just bytes with no interpretation

class missive.missive.TestAdapter(processor: missive.missive.Processor[~M][M])

Bases: missive.missive.Adapter

ack(message: M) → None

Mark a message as acknowledged.

Parameters:message – The message object to be acknowledged.
close() → None
nack(message: M) → None

Mark a message as negatively acknowledged.

The meaning of this can vary depending on the message transport in question but generally it either returns the message to the message bus queue from which it came or triggers some special processing via some (message bus specific) dead letter queue.

Parameters:message – The message object to be acknowledged.
send(message: M) → None

missive.shutdown_handler module

class missive.shutdown_handler.ShutdownHandler(callback: Optional[Callable[[int], None]] = None)

Bases: object

enable() → None
set_flag() → None
should_exit() → bool
signal_handler(signal: int, frame: Any) → None
wait_for_flag() → None

Module contents