Coder Social home page Coder Social logo

gertx's Introduction

gertx

Is a grails-plugin that allows use Vert.x

verion 0.0.1

https://github.com/rodrigoSaladoAnaya/gertx

  1. Use the PlatformManager to carry Vertx to Grails and expose a EventBus instance to use into de GrailsApp

  2. The plugin adds two JavaScript libraries sockjs.min.js and vertxbus.js in web-app/js/libs/ directory, so you can use the power of EventBus from the view more comfortably.

  3. Also adds a verticle serving as administrator other verticles in grails-app/vertx/ directory called VerticleManager.groovy that you can access e.g. via telnet to deploy, undeploy verticles and list installed and uninstalled verticles.

  4. To use gertx inside your grails application runtime you have to:

  • Add "gertx: 0.1" in BuildConfig.groovy as a plugin
  • Add into BootStrap.groovy 'def gertxService'
  • Init Vertx with 'gertxService.initVertx()' If you just want to use within the services
  • And if you want to use external verticles help you install and uninstall add 'gertxService.runVerticleManager()'
  • e.g.:
class BootStrap {
    def gertxService
    def init = { servletContext ->
        gertxService.initVertx()
        gertxService.runVerticleManager()
    }
}
  • If you use the VerticleManager be accessed from a terminal with the command 'telnet localhost 5436' to manage verticles.
  • To add a new verticle must create it in the folder grails-app/vertx/
  • e.g.: If you want to create a EventBus Bridge called WebEventBus.groovy create a file create a file with that name in the folder grails-app/vertx/ and type something like:
def server = vertx.createHttpServer()
server.requestHandler { req ->
}
vertx.createSockJSServer(server).bridge(
    prefix: '/eventbus', [[:]], [[:]]
)
server.listen(5540)
  • Restart your grails app and I enjoy it.

References: http://vertx.io/embedding_manual.html#embedding-the-VERTX-platform http://vertx.io/docs.html http://vertx.io/core_manual_groovy.html#sockjs-eventbus-bridge

gertx's People

Contributors

rodrigosaladoanaya avatar burtbeckwith avatar

Watchers

 avatar Alcides Flores Pineda avatar  avatar

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.