Coder Social home page Coder Social logo

nepxion / eventbus Goto Github PK

View Code? Open in Web Editor NEW
73.0 6.0 39.0 218 KB

💢 Nepxion EventBus is a generic event dispatching component based on Google Guava with Spring framework AOP, support synchronous and asynchronous mode 基于Google Guava通用事件派发机制的事件总线组件,注解式发布订阅

Home Page: http://www.nepxion.com

License: Apache License 2.0

Java 97.32% Batchfile 2.68%
matrix eventbus spring-autoproxy google-guava

eventbus's People

Contributors

haojunren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

eventbus's Issues

guava的@Subscribe的synchronized问题

Hi,你好,提个问题,guava的EventBus.register()注册时,会最终调用Subscriber.create()方法,如下,会判断方法上是否有AllowConcurrentEvents注解,来创建不同的Subscriber,如果没有AllowConcurrentEvents注解则创建SynchronizedSubscriber,而这个类的invokeSubscriberMethod方法中使用了synchronized作为同步,所以如果只是加上注解Subscribe在方法上,那么非真正的并发.

...
    static Subscriber create(EventBus bus, Object listener, Method method) {
        return (Subscriber)(isDeclaredThreadSafe(method) ? new Subscriber(bus, listener, method) : new Subscriber.SynchronizedSubscriber(bus, listener, method));
    }
...
    private static boolean isDeclaredThreadSafe(Method method) {
        return method.getAnnotation(AllowConcurrentEvents.class) != null;
    }

    @VisibleForTesting
    static final class SynchronizedSubscriber extends Subscriber {
        private SynchronizedSubscriber(EventBus bus, Object target, Method method) {
            super(bus, target, method, null);
        }

        void invokeSubscriberMethod(Object event) throws InvocationTargetException {
            synchronized(this) {
                super.invokeSubscriberMethod(event);
            }
        }
    }
...

分布式

分布式

目前支持分布式吗? 集成消息中间件rabbitmq,kafka等?

好扩展吗?

我想扩展一个订阅端出了异常重试的机制。请问好扩展吗

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.