Git Product home page Git Product logo

jbus's People

Contributors

anidotnet avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

fredtucs forchid

jbus's Issues

Fork with a few ideas

Hey, great project. I created a fork here with a few changes:
https://github.com/regbo/jbus

The changes include:

  • token replacement in logging (if an event has an expensive toString() that can slow logging down)
  • removed a lot of the error logging, as I figure that should just be thrown
  • custom thread pools, for fine grained tuning
  • added the ability to throw an exception on no listeners
  • made listeners listen to subclasses
  • add type arguments to jbus and a special Listener class. if you use JBus it's the same as the master, but if you use JBus you can add lambdas in java 8 like so:
    		JBus<Date> jbus = new JBus<>(Date.class, Executors.newCachedThreadPool());
    		jbus.register(d -> {
    			System.out.println("the date is:" + d);
    		});
    		jbus.post(new Date());
    
    • added thread tracking so that static deregister calls can be made from within listeners. for example, the following will only print once, not 3 times:
    		JBus<Date> jbus = new JBus<>(Date.class, Executors.newCachedThreadPool());
    		jbus.register(d -> {
    			JBus.deregister();
    			System.out.println("the date is:" + d);
    		});
    		jbus.post(new Date());
    		jbus.post(new Date());
    		jbus.post(new Date());
    

    The above work well for us, so I figured I'd share. Cheers.

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.