public void handleEvent ( final BitfinexStreamSymbol symbol ) { final List < FutureOperation > futuresToFinish = pendingFutures . stream ( ) . filter ( f -> f . getSymbol ( ) . equals ( symbol ) ) . collect ( Collectors . toList ( ) ) ; pendingFutures . removeAll ( futuresToFinish ) ; futuresToFinish . forEach ( f -> f . setToDone ( ) ) ; }
Handle a subscribe or unsubscribe event