Examples of runOnContext()


Examples of org.vertx.java.core.Context.runOnContext()

        // Make sure the callback runs on the vert.x thread
        return new FutureCallback<V>() {
            @Override
            public void onSuccess(final V result) {
                context.runOnContext(new Handler<Void>() {
                    @Override
                    public void handle(Void aVoid) {
                        callback.onSuccess(result);
                    }
                });
View Full Code Here

Examples of org.vertx.java.core.Context.runOnContext()

                });
            }

            @Override
            public void onFailure(final Throwable t) {
                context.runOnContext(new Handler<Void>() {
                    @Override
                    public void handle(Void aVoid) {
                        callback.onFailure(t);
                    }
                });
View Full Code Here

Examples of org.vertx.java.core.Vertx.runOnContext()

                        if (hasNext()) {
                            params.set(param, m.group(param));
                            final Middleware paramMiddleware = paramProcessors.get(param);
                            if (paramMiddleware != null) {
                                // do not block main loop
                                vertx.runOnContext(new Handler<Void>() {
                                    @Override
                                    public void handle(Void event) {
                                        paramMiddleware.handle(request, new Handler<Object>() {
                                            @Override
                                            public void handle(Object err) {
View Full Code Here

Examples of org.vertx.java.core.Vertx.runOnContext()

                            new AsyncIterator<Middleware>(binding.middleware) {
                                @Override
                                public void handle(final Middleware middleware) {
                                    if (hasNext()) {
                                        // do not block main loop
                                        vertx.runOnContext(new Handler<Void>() {
                                            @Override
                                            public void handle(Void event) {
                                                middleware.handle(request, new Handler<Object>() {
                                                    @Override
                                                    public void handle(Object err) {
View Full Code Here

Examples of org.vertx.java.core.Vertx.runOnContext()

                new AsyncIterator<Middleware>(binding.middleware) {
                    @Override
                    public void handle(final Middleware middleware) {
                        if (hasNext()) {
                            // do not block main loop
                            vertx.runOnContext(new Handler<Void>() {
                                @Override
                                public void handle(Void event) {
                                    middleware.handle(request, new Handler<Object>() {
                                        @Override
                                        public void handle(Object err) {
View Full Code Here

Examples of org.vertx.java.core.impl.DefaultContext.runOnContext()

  public void runOnContext(final Handler<Void> task) {
    DefaultContext context = getContext();
    if (context == null) {
      throw new IllegalStateException("Not on a Vert.x context");
    }
    context.runOnContext(task);
  }

  @Override
  public boolean isEventLoop() {
    return vertx.isEventLoop();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.