arxiv.canonical.role.role module

class arxiv.canonical.role.role.Observer(storage, sources, stream, name='all')[source]

Bases: arxiv.canonical.role.register.NoRegister, arxiv.canonical.role.stream.Listener, arxiv.canonical.role.role.Role

A system that processes canonical e-print events.

Such a system might perform operations in response to canonical events that fall outside of the maintenance of the canonical record. For example, it might update a secondary index with a subset of data in the event stream.

on_event(event)[source]
Return type

None

class arxiv.canonical.role.role.Primary(storage, sources, stream, name='all')[source]

Bases: arxiv.canonical.role.register.Writer, arxiv.canonical.role.stream.Emitter, arxiv.canonical.role.role.Role

The primary canonical record.

All events are first written to and emitted from this authoritative record.

class arxiv.canonical.role.role.Replicant(storage, sources, stream, name='all')[source]

Bases: arxiv.canonical.role.register.Writer, arxiv.canonical.role.stream.Listener, arxiv.canonical.role.role.Role

A system that transcribes events to a secondary record.

The primary use-case is for mirror sites.

on_event(event)[source]
Return type

None

class arxiv.canonical.role.role.Repository(storage, sources, stream, name='all')[source]

Bases: arxiv.canonical.role.register.Reader, arxiv.canonical.role.stream.NoStream, arxiv.canonical.role.role.Role

A read-only API onto the canonical record.

class arxiv.canonical.role.role.Role(storage, sources, stream, name='all')[source]

Bases: abc.ABC

property register

Register a virtual subclass of an ABC.

Returns the subclass, to allow usage as a class decorator.

Return type

IRegisterAPI

set_register(storage, sources, name='all')[source]
Return type

None

set_stream(stream, sources, name='all')[source]
Return type

None

property stream

IEventStream

Type

rtype