Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Delivery ¶
type Delivery struct { // ActorID contains the ActivityPub // actor ID IRI (if any) of the activity // being sent out by this request. ActorID string // ObjectID contains the ActivityPub // object ID IRI (if any) of the activity // being sent out by this request. ObjectID string // TargetID contains the ActivityPub // target ID IRI (if any) of the activity // being sent out by this request. TargetID string // Request is the prepared (+ wrapped) // httpclient.Client{} request that // constitutes this ActivtyPub delivery. Request *httpclient.Request // contains filtered or unexported fields }
Delivery wraps an httpclient.Request{} to add ActivityPub ID IRI fields of the outgoing activity, so that deliveries may be indexed (and so, dropped from queue) by any of these possible ID IRIs.
func (*Delivery) Deserialize ¶ added in v0.17.0
Deserialize will attempt to deserialize a blob of task data, which will involve unflattening previously serialized data and leave delivery incomplete, still requiring signing func setup.
type Worker ¶
type Worker struct { // Client is the httpclient.Client{} that // delivery worker will use for requests. Client *httpclient.Client // Queue is the Delivery{} message queue // that delivery worker will feed from. Queue *queue.StructQueue[*Delivery] // contains filtered or unexported fields }
Worker wraps an httpclient.Client{} to feed from queue.StructQueue{} for ActivityPub reqs to deliver. It does so while prioritizing new queued requests over backlogged retries.
type WorkerPool ¶
type WorkerPool struct { // Client defines httpclient.Client{} // passed to each of delivery pool Worker{}s. Client *httpclient.Client // Queue is the embedded queue.StructQueue{} // passed to each of delivery pool Worker{}s. Queue queue.StructQueue[*Delivery] // contains filtered or unexported fields }
WorkerPool wraps multiple Worker{}s in a singular struct for easy multi start/stop.
func (*WorkerPool) Init ¶
func (p *WorkerPool) Init(client *httpclient.Client)
Init will initialize the Worker{} pool with given http client, request queue to pull from and number of delivery workers to spawn.
func (*WorkerPool) Start ¶
func (p *WorkerPool) Start(n int)
Start will attempt to start 'n' Worker{}s.
func (*WorkerPool) Stop ¶
func (p *WorkerPool) Stop()
Stop will attempt to stop contained Worker{}s.