take

fun take(times: Int): EventBuilder<T>

Configures the listener to unregister itself after a certain number of executions.

Parameters

times

The number of times to handle the event.