public Subscription unsubscribe ( int after ) { if ( this . dispatcher != null ) { throw new IllegalStateException ( "Subscriptions that belong to a dispatcher cannot respond to unsubscribe directly." ) ; } else if ( this . incoming == null ) { throw new IllegalStateException ( "This subscription is inactive." ) ; } if ( isDraining ( ) ) { // No op while draining return this ; } this . connection . unsubscribe ( this , after ) ; return this ; }
Unsubscribe this subscription and stop listening for messages after the specified number of messages .