Skip to content
This repository has been archived by the owner on Sep 20, 2022. It is now read-only.

Execute callables within Gumshoe managed context #27

Merged
merged 1 commit into from
Aug 26, 2016

Conversation

lwoodson
Copy link
Contributor

Addresses issue #26 to give callback interfaces to be executed within a Gumshoe managed context. The context will start, execute the callable, finish the context (or fail it if exception) then return result (or propagate exception).

Two interfaces are supported -- the standard lib Callable interface when you care about a return value and the Gumshoe provided VoidCallable interface when you don't care about a return value.

This works w/anonymous classes:

context.start(new VoidCallable() {
    public void call() {
        // do something
    };
});

and java 8 lambda syntax:

context.start(() -> {
    // do something
});

Addresses issue #26 to give callback interfaces to be executed
within a Gumshoe  managed context.  The context will start,
execute the callable, finish the context (or fail it if exception)
then return result (or propagate exception).

Two interfaces are supported -- the standard lib Callable interface
when you care about a return value and the Gumshoe provided
VoidCallable interface when you don't care about a return value.
@lewisren
Copy link

💯

@lwoodson lwoodson merged commit 8181fb1 into master Aug 26, 2016
@lwoodson lwoodson deleted the in_context_callbacks branch August 26, 2016 12:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants