Search in sources :

Example 1 with Aim

use of io.vertx.up.rs.Aim in project vertx-zero by silentbalanceyh.

the class EventAxis method mount.

@Override
public void mount(final Router router) {
    // Extract Event foreach
    EVENTS.forEach(event -> {
        // Build Route and connect to each Action
        Fn.safeSemi(null == event, LOGGER, () -> LOGGER.warn(Info.NULL_EVENT, getClass().getName()), () -> {
            // 1. Verify
            Verifier.verify(event);
            final Route route = router.route();
            // 2. Path, Method, Order
            Hub<Route> hub = Fn.poolThread(Pool.URIHUBS, () -> Instance.instance(UriHub.class));
            hub.mount(route, event);
            // 3. Consumes/Produces
            hub = Fn.poolThread(Pool.MEDIAHUBS, () -> Instance.instance(MediaHub.class));
            hub.mount(route, event);
            // 4. Request validation
            final Depot depot = Depot.create(event);
            // 5. Request workflow executor: handler
            final Aim aim = this.splitter.distribute(event);
            route.handler(this.verifier.signal(depot)).failureHandler(ZeroRxEndurer.create());
        });
    });
}
Also used : Aim(io.vertx.up.rs.Aim) Depot(io.vertx.up.atom.agent.Depot) Route(io.vertx.reactivex.ext.web.Route)

Aggregations

Route (io.vertx.reactivex.ext.web.Route)1 Depot (io.vertx.up.atom.agent.Depot)1 Aim (io.vertx.up.rs.Aim)1