You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Tellier Benoit (JIRA)" <ji...@apache.org> on 2019/01/25 03:58:00 UTC
[jira] [Commented] (MAILBOX-364) Create an EventBus
[ https://issues.apache.org/jira/browse/MAILBOX-364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16751874#comment-16751874 ]
Tellier Benoit commented on MAILBOX-364:
----------------------------------------
https://github.com/linagora/james-project/pull/2127 MAILBOX-364 Move event related classes in event package of mailbox-api
> Create an EventBus
> ------------------
>
> Key: MAILBOX-364
> URL: https://issues.apache.org/jira/browse/MAILBOX-364
> Project: James Mailbox
> Issue Type: New Feature
> Components: events
> Reporter: Tellier Benoit
> Priority: Major
>
> The idea:
> - The caller is reponsible of unsubscribing
> - Clearly separate concerns between 'jobs' and 'registrations'
> - Generify the concept of 'registration' so that I can register stuff on more that a mailbox.
> The API proposal:
> First let's create registration keys:
> {code:java}
> interface Key {
> }
> class MailboxIdKey implements Key {
> MailboxId id;
> }
> class UserKey implements Key {
> User user;
> }
> {code}
> Groups of workers:
> {code:java}
> interface Group {}
> interface QuotaUpdaterGroup extends Group {}
> {code}
> A registration:
> {code:java}
> interface Registration {
> void unregister();
> }
> {code}
> Then the event bus API:
> {code:java}
> interface EventBus {
> Registration register(Listener listener, Key key);
> Registration register(Listener listener, Group group);
> CompletableFuture<Void> dispatch(Event event, Key key);
> CompletableFuture<Void> dispatch(Event event, Set<Key> key);
> }
> {code}
> You will:
> - Implement this API and related contract tests with a memory implementation
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org