Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor ActivitiesHandlerMixin #1230

Open
srosset81 opened this issue Feb 3, 2024 · 2 comments
Open

Refactor ActivitiesHandlerMixin #1230

srosset81 opened this issue Feb 3, 2024 · 2 comments

Comments

@srosset81
Copy link
Contributor

srosset81 commented Feb 3, 2024

Problem

Right now, for every service using the ActivitiesHandlerMixin, a matching is made for all activities received or sent. The more services are doing this, the worst the performance become.

Solution

Create a ActivitiesWatcherService which is activated by default with the ActivityPub service.

This service as a watch action which takes a matcher (object or function), an actionName and a key.

On start, the ActivitiesHandlerMixin calls the watch function for all defined activities. The actionName is a processActivity action of this mixin.

The process action receives a key, a boxType (inbox/outbox), a dereferencedActivity and actorUri.

It thens calls the onEmit and onReceive methods of the corresponding activity.

@srosset81
Copy link
Contributor Author

srosset81 commented Feb 4, 2024

Ideas:

@srosset81
Copy link
Contributor Author

Done here #1240 but performances could be improved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant