Giter Site home page Giter Site logo

jruby-utils's Introduction

JRuby Utils

A library for creating and interacting with a pool of JRuby instances in Clojure.

Build Status

Usage

This is a brief overview of the functionality of this library; TODO add more docs.

This library provides three public namespaces: puppetlabs.services.jruby-pool-manager.jruby-schemas, puppetlabs.services.jruby-pool-manager.jruby-pool-manager-service, and puppetlabs.services.jruby-pool-manager.jruby-core.

The entry-point into most of the functionality this library provides is the jruby-pool-manager-service Trapperkeeper service's create-pool, which creates and returns a pool context and asynchronously starts filling the pool.

create-pool takes a config matching the JRubyConfig schema; this config can be created and provided defaults by the jruby-core/initialize-config function. The non-optional config settings that you must provide are ruby-load-path and gem-home.

You can provide custom initialization and callback logic by providing lifecycle functions for initializing the scripting container, initializing the pool instance, cleaning up a pool instance, and cleaning up the pool for shutdown.

After the pool has been created, use the borrow and return functions to work with instances. There is a with-jruby-instance macro to make this easier. There is also a with-lock macro that holds a lock on the pool (so that no borrows can take place) while you execute some logic.

In most TK apps where you want to work with JRuby instances, you will want to call create-pool in the init lifecycle of your service, and then call jruby-core/flush-pool-for-shutdown! in the stop lifecycle function.

License

See LICENSE.

Support

We use the Trapperkeeper project on JIRA for tickets on this project, although Github issues are welcome too.

jruby-utils's People

Contributors

briancain avatar call avatar camlow325 avatar cprice404 avatar dankreek avatar elyscape avatar gguillotte avatar haus avatar hunner avatar inhumantsar avatar jasperla avatar jpinsonault avatar jtappa avatar justinstoller avatar kevincorcoran avatar melissa avatar mmckinst avatar mslilah avatar nfagerlund avatar nicklewis avatar nwolfe avatar petems avatar puppetlabs-jenkins avatar rlinehan avatar scotje avatar stahnma avatar steveax avatar theshanx avatar vilmibm avatar waynr avatar

Watchers

 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.