bovine_herd
BovineHerd(app, start_background_task_inbox=None, start_background_task_outbox=None, handle_outbox_item=handle_outbox_item, db_url='sqlite://bovine.sqlite3', authorization_adder=add_authorization)
Configures the quart app to use bovine herd. Requires a bovine_store compatible store to be available at app.config[“bovine_store”]. Configures the endpoints
- /.well-known
- /activitypub
- /endpoints
- /objects
Parameters:
Name | Type | Description | Default |
---|---|---|---|
app |
Quart
|
The quart app to add the endpoints to. |
required |
start_background_task_inbox |
Callable[[ProcessingItem, BovineStoreActor], Awaitable] | None
|
awaitable that asynchronously handles Activities that arrived at an inbox endpoint |
None
|
handle_outbox_item |
Callable[[ProcessingItem, BovineStoreActor], Awaitable]
|
awaitable that synchronously handles Activities that arrived at an outbox endpoint. This function should add the new id of the Activity to the ProcessingItem, so it can be returned in the location header. |
handle_outbox_item
|
start_background_task_outbox |
Callable[[ProcessingItem, BovineStoreActor], Awaitable] | None
|
awaitable that asynchronously handles Activities that arrived at an outbox endpoint |
None
|
db_url |
str
|
The database connection |
'sqlite://bovine.sqlite3'
|
authorization_adder |
Callable[[], Awaitable]
|
function that stores the performer of the request in g.requester |
add_authorization
|
Source code in bovine_herd/bovine_herd/__init__.py
build_default_background_task_inbox(app)
Creates a background task runner for the inbox based on starting quart.add_background_task.
Source code in bovine_herd/bovine_herd/__init__.py
build_default_background_task_outbox(app)
Creates a background task runner for the outbox based on starting quart.add_background_task.
Source code in bovine_herd/bovine_herd/__init__.py
add_to_queue(item, *args)
async
If current.app.config[“bovine_pub_sub”] is set, adds the item to a queue
FIXME: Improve logic on how the queue is chosen FIXME: event-id logic