Skip to content

Overview

bovine_process consists of routines to deal with side effects. The behavior defined in this package corresponds to 6. Client to Server Interactions and 7. Server to Server Interactions of the ActivityPub specification.

We note that the implementation here is neither complete nor contained in ActivityPub. For example, it is unclear from ActivityPub how to treat a Dislike Activity, our choice to add it to the likes collection, is different than the one done by Peertube (see here for their Video object having a dislike collection).

Structure of the package

bovine_process

The bovine_process package contains the basic definitions of interactions, and routines to handle them. For example the method process_inbox_item should contain all the necessary steps to process arriving in the inbox.

Currently, objects are wrapped as a ProcessingItem for bovine_process to be able to comprehend them. Furthermore, the current processing logic depends on actor being a BovineStoreActor. However, this a restriction that will hopefully be dropped in the future. InteractionActor is a first step towards abstracting away what is necessary towards processing activities.

bovine_propan

The bovine_propan package contains an alternative way to process activities. Whereas with directly calling the routines from bovine_process executes the code inside the main program, bovine_propan moves the logic into an extra process based on faststream. Communication between the server process and the processing process is done through RabbitMQ. This moves the entire queueing process to an external specialized program.

Beside the advantage of not having to write queue messaging code, this leads to a more modular architecture. For example, once everything works properly one should be able to have a server, i.e. bovine_herd, with only a read connection to the database.

This leads to the request patterns

flowchart LR
A((user)) -->|GET /resource| B[bovine_herd]
B[bovine_herd] -->|read| C[(postgres)]

and for POST requests

flowchart LR
A((user)) -->|POST /inbox| B[bovine_herd]
B -.->|enqueues| C{{RabbitMQ}}
C --> D[bovine_propan]
D --> C
D -->|reads| E[(postgres)]
D -->|writes| E

We note that once enqueuing is done everything can be done fully asynchronously.

Roadmap

The structure of this package is not final. The final goal is to make bovine_propan sufficiently configurable that one can create an Activity processor suited to ones need, without having to fork the package.

It is not entirely clear how to do this, as one should be able to have

  • Processors that are invoked for some subset of actors (on the server)
  • Processors that are invoked for some type of activities

Testing

In addition to unit tests contained in the appropriate packages starting with a test_ prefix, there is also a sequence of integration type tests for this package. This process is explained in Integration tests.