Giter VIP home page Giter VIP logo

vertx-wetm-library's Introduction

Vertx Web East To Make library Build Status Coverage Status

This project was developed to use Vertx like Spring. This library adds the some benefits of Spring Framework to Vertx.

Functions

  • Annotation Routing
  • Automatic parsing filed(query, path)
  • Easy async jobs
  • Managing services

How to use

dependency

You can use this library with jitpack.

Required

You must route registering to use the library. using RouteRegister for using annotation routing function. When you invoke the route method, the package is the location that contains the routers.

RouteRegister routeRegister = RouteRegister.routing(vertx);
Router router = routeRegister.getRouter();
router.route().handler(BodyHandler.create());
...
routeRegister.route(this.getClass().getPackage().getName());

Examples

The example shows how to use the vertx server library.

Simple routing with annotation

This library provide simple routing with annotations. You can use @RouteRegistration for register handler with uri and http method. library will parsing field(with query, path) and binding to method parameters automatically.

public class ExampleRouter extends AbstractRouter {

    @RouteRegistration(uri = "/update", method = HttpMethod.POST)
    public void signin(RoutingContext ctx, @Param(name="arg1") String arg1, @Param(name="arg2") String arg2) {
        ...
    }
}

Services

You can also binding service with @Service annotation. library will auto binding service to field. The service is managed by creating only one instance. The service need implement with extend AbstractService

public class AuthRouter extends AbstractRouter {

    @Service
    private AuthService authService;
    ...
}

Async Jobs

Vertx is recommended to use separate threads for long operations. So, we provides the ability to perform asynchronous tasks easily.

// in AbstractService or AbstractRouter
private void example(){
    doAsync(future -> {
            ... doing jobs
            future.complete();
    });
}

vertx-wetm-library's People

Contributors

boxfox619 avatar

Watchers

James Cloos avatar  avatar

vertx-wetm-library's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.