Package com.droidkit.actors.typed.messages

Examples of com.droidkit.actors.typed.messages.TypedFutureResult


    }

    @Override
    public boolean onReceive(Object message) {
        if (message instanceof TypedFutureResult) {
            TypedFutureResult futureResult = (TypedFutureResult) message;
            AskContainer container = containers.remove(futureResult.getId());
            if (container != null) {
                if (container.callback != null) {
                    container.callback.onResult(futureResult.getRes());
                }
            }
            return true;
        } else if (message instanceof TypedFutureError) {
            TypedFutureError futureError = (TypedFutureError) message;
View Full Code Here


    public <T> void ask(Future<T> future, FutureCallback<T> callback) {
        final int id = askId.incrementAndGet();
        future.addListener(new FutureCallback<T>() {
            @Override
            public void onResult(T result) {
                self.send(new TypedFutureResult(id, result));
            }

            @Override
            public void onError(Throwable throwable) {
                self.send(new TypedFutureError(id, throwable));
View Full Code Here

TOP

Related Classes of com.droidkit.actors.typed.messages.TypedFutureResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.