subscribe

fun <TCallback : ICallbackMsg> subscribe(callbackType: Class<out TCallback>, jobID: JobID, callbackFunc: Consumer<TCallback>): Closeable

Registers the provided Consumer to receive callbacks of type TCallback

Return

An Closeable. Disposing of the return value will unsubscribe the callbackFunc .

Parameters

TCallback

The type of callback to subscribe to. If this is JobID.INVALID, all callbacks of type TCallback will be received.

callbackType

The type of the callback

jobID

The JobID of the callbacks that should be subscribed to.

callbackFunc

The function to invoke with the callback.


fun <TCallback : ICallbackMsg> subscribe(callbackType: Class<out TCallback>, callbackFunc: Consumer<TCallback>): Closeable

Registers the provided Consumer to receive callbacks of type TCallback

Return

An Closeable. Disposing of the return value will unsubscribe the callbackFunc.

Parameters

TCallback

The type of callback to subscribe to.

callbackType

type of the callback

callbackFunc

The function to invoke with the callback.