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.
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 amatcher
(object or function), anactionName
and akey
.On start, the ActivitiesHandlerMixin calls the
watch
function for all defined activities. TheactionName
is aprocessActivity
action of this mixin.The
process
action receives akey
, aboxType
(inbox/outbox), adereferencedActivity
andactorUri
.It thens calls the onEmit and onReceive methods of the corresponding activity.