/// <summary> /// Constructor that gets the finder of methods marked with specific atrributes. /// </summary> /// <param name="finder"></param> public EventBus(IHandlerFindingStrategy finder) { //TODO : readerwriterlockslim , conccurentdictionary. //Replace with ninject tools. this.finder = finder; handlersByType = HashMultiMap<Type, EventHandler>.Create(); handlersByTypeLock = new ReaderWriterLockSlim(); eventsToDispatch = new ThreadLocal<Queue<EventWithHandler>>(() => { return new Queue<EventWithHandler>(); }); isDispatching = new ThreadLocal<Boolean>(() => { return false; }); }
/// <summary> /// Constructor that gets the finder of methods marked with specific atrributes. /// </summary> /// <param name="finder"></param> public EventBus(IHandlerFindingStrategy finder) { //TODO : readerwriterlockslim , conccurentdictionary. //Replace with ninject tools. this.finder = finder; handlersByType = HashMultiMap <Type, EventHandler> .Create(); handlersByTypeLock = new ReaderWriterLockSlim(); eventsToDispatch = new ThreadLocal <Queue <EventWithHandler> >(() => { return(new Queue <EventWithHandler>()); }); isDispatching = new ThreadLocal <Boolean>(() => { return(false); }); }