public Emitter on ( String event , Listener fn ) { ConcurrentLinkedQueue < Listener > callbacks = this . callbacks . get ( event ) ; if ( callbacks == null ) { callbacks = new ConcurrentLinkedQueue < Listener > ( ) ; ConcurrentLinkedQueue < Listener > _callbacks = this . callbacks . putIfAbsent ( event , callbacks ) ; if ( _callbacks != null ) { callbacks = _callbacks ; } } callbacks . add ( fn ) ; return this ; }
Listens on the event .