Expand description
Sending activities through the queue.
Deliverer::send queues an activity for a set of inboxes and returns;
Deliverer::run is the loop that sends what is queued, and the
application spawns it on whatever runtime and in whatever task context it
uses — Ojak does not spawn tasks of its own. Any number of loops may run,
in any number of processes, over one queue.
A batch, such as moving every account’s followers, has to finish:
Deliverer::send_batch tags each delivery so that the batch can be
followed, and gives it a deadline, past which it is given up on rather
than retried, so that one server that is down or too slow does not hold
the batch open for as long as the retry policy would.
A portable inbox (FEP-ef61) has no host of its own, only the gateways its
actor lists; Deliverer::send_portable queues it with them, and one
attempt tries each in order until one accepts.
Structs§
- Batch
- What a batch of deliveries shares: a tag to find them by, when to give up on the ones that have not gone through, and what they are sent in order with.
- Caching
Sender Keys SenderKeysthat keeps each keyinnergives forttlafter loading it, so that it is not loaded again for every delivery it signs.- Circuit
Breaker - Holding back deliveries to a destination that keeps failing, rather than sending each one to fail in turn, as a Stoplight with its default strategies does.
- Deliverer
- Queues activities and sends them.
- Deliverer
Config - How the delivery loop behaves.
- Delivery
Attempt - One attempt at a delivery, as it came out.
- Delivery
Failure - A delivery that will not be tried again.
- Memory
Breakers - Breakers in memory, each deliverer its own: the default.
- Portable
Inbox - A portable actor’s inbox, and the gateways that accept deliveries to it, in the order its actor lists them.
- Priority
- Where sends to few inboxes go, and how few is few.
- Probe
- The right to probe a half-open breaker, which only one delivery holds at a time. What a store keeps in it — a lock it releases when it is dropped, say — is the store’s own.
- Settled
- A delivery that is done with, other than by running out of retries or
its batch’s deadline: what
Deliverer::on_settledis told.
Enums§
- Admission
- Whether a delivery may be sent, as a
BreakerStoreanswers. - Attempt
Outcome - How an attempt came out.
- Breaker
Scope - What a circuit breaker is kept for.
- Delivery
Error - Why a delivery did not go through.
- Settled
Outcome - How a delivery settled.
Traits§
- Breaker
Store - Where circuit breakers are kept: in the deliverer’s memory unless the application gives it a store of its own, such as one in Redis that the deliverers of every process share, as Mastodon keeps its Stoplights.
- Sender
Keys - Where a sender’s signing key comes from: the application.
Functions§
- deliver
- Deliver
bodytoinbox, signed withkey, tryingfirstand then the other scheme iffirstis refused. Returns the scheme that was accepted. - deliver_
with_ headers deliver, withextraheaders sent beside the signature’s, such as aCollection-Synchronizationheader (FEP-8fcf). They are not signed.- permanent_
status - Whether an inbox answering
statusis answering what will not change: a 4xx, except 408 and 429, which say the request came at a bad time.
Type Aliases§
- Breaker
Future - A future a
BreakerStoreanswers with.