amoorion.nats.service

The daemon’s service: what arrives on <prefix>.in.> is kept in the inbox.

Functions

to_message(subject, data)

A NATS message as an inbox message: JSON with text is read, the rest kept as plain text.

Classes

NatsService(server[, vault, inbox])

A daemon service: keeps what arrives on <prefix>.in.> in the inbox.

amoorion.nats.service.to_message(subject, data)[source]

A NATS message as an inbox message: JSON with text is read, the rest kept as plain text.

Parameters:
  • subject (str)

  • data (bytes)

Return type:

Message

class amoorion.nats.service.NatsService(server, vault=None, inbox=None)[source]

Bases: Controller

A daemon service: keeps what arrives on <prefix>.in.> in the inbox.

Parameters:
  • server (str)

  • vault (Vault | None)

  • inbox (Inbox | None)

async run()[source]

Subscribe and wait for stop; draining lets what has arrived finish.

Return type:

None

async stop()[source]

End run.

Return type:

None