Skip to content

Support for one-to-one singular communication #176

@mauriciogior

Description

@mauriciogior

I don't know if this makes sense to you, but it might be useful in some cases (avoids sending events from one to another). I don't know the best way to run this on scenarios with more than one class listening to SomeEvent.

// ... some class listening to SomeEvent
public int onEvent(SomeEvent event) {
    if (event.message.equals("something")) {
        return 1;
    }

    return 0;
}

// ... some class that triggers a SomeEvent
public void whichValue() {
    EventBus.getDefault()
        .post(new SomeEvent("something"), new OnResult() {
            public void onResult(int result) {
                // do something with result
            }
        });
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions