View Source ActivityPub.Federator.Publisher behaviour (Bonfire v0.9.10-classic-beta.169)
Defines the contract used by federation implementations to publish messages to their peers.
TODO: why not use APPublisher
directly instead?
Summary
Callbacks
Gathers links used by an outgoing federation module for WebFinger output.
Determine whether an activity can be relayed using the federation module.
Relays an activity to all specified peers.
Relays an activity to a specified peer, determined by the parameters. The parameters used are controlled by the federation module.
Functions
Enqueue publishing a single activity.
Callbacks
@callback gather_webfinger_links(Map.t()) :: list()
Gathers links used by an outgoing federation module for WebFinger output.
@callback is_representable?(Map.t()) :: boolean()
Determine whether an activity can be relayed using the federation module.
@callback publish(Map.t(), Map.t()) :: :ok | {:error, any()}
Relays an activity to all specified peers.
@callback publish_one(Map.t()) :: {:ok, Map.t()} | {:error, any()}
Relays an activity to a specified peer, determined by the parameters. The parameters used are controlled by the federation module.