public class CallbackManager extends java.lang.Object implements ICallbackMgrInternals
SteamClient instance that will be posting callbacks.| Constructor and Description |
|---|
CallbackManager(SteamClient steamClient)
Initializes a new instance of the
CallbackManager class. |
| Modifier and Type | Method and Description |
|---|---|
void |
register(in.dragonbra.javasteam.steam.steamclient.callbackmgr.CallbackBase callback) |
void |
runCallbacks()
Runs a single queued callback.
|
void |
runWaitAllCallbacks(int timeout)
Blocks the current thread to run all queued callbacks.
|
void |
runWaitCallbacks()
Blocks the current thread to run a single queued callback.
|
void |
runWaitCallbacks(long timeout)
Blocks the current thread to run a single queued callback.
|
<TCallback extends ICallbackMsg> |
subscribe(java.lang.Class<? extends TCallback> callbackType,
Consumer<TCallback> callbackFunc)
REgisters the provided
Consumer to receive callbacks of type TCallback |
<TCallback extends ICallbackMsg> |
subscribe(java.lang.Class<? extends TCallback> callbackType,
JobID jobID,
Consumer<TCallback> callbackFunc)
REgisters the provided
Consumer to receive callbacks of type TCallback |
void |
unregister(in.dragonbra.javasteam.steam.steamclient.callbackmgr.CallbackBase callback) |
public CallbackManager(SteamClient steamClient)
CallbackManager class.steamClient - The SteamClient instance to handle the callbacks of.public void runCallbacks()
public void runWaitCallbacks(long timeout)
timeout - The length of time to block.public void runWaitCallbacks()
public void runWaitAllCallbacks(int timeout)
timeout - The length of time to block.public <TCallback extends ICallbackMsg> java.io.Closeable subscribe(java.lang.Class<? extends TCallback> callbackType, JobID jobID, Consumer<TCallback> callbackFunc)
Consumer to receive callbacks of type TCallbackTCallback - The type of callback to subscribe to.callbackType - type of the callbackjobID - The JobID of the callbacks that should be subscribed to.callbackFunc - The function to invoke with the callback.Closeable. Disposing of the return value will unsubscribe the callbackFunc .public <TCallback extends ICallbackMsg> java.io.Closeable subscribe(java.lang.Class<? extends TCallback> callbackType, Consumer<TCallback> callbackFunc)
Consumer to receive callbacks of type TCallbackTCallback - The type of callback to subscribe to.callbackType - type of the callbackcallbackFunc - The function to invoke with the callback.Closeable. Disposing of the return value will unsubscribe the callbackFunc .public void register(in.dragonbra.javasteam.steam.steamclient.callbackmgr.CallbackBase callback)
register in interface ICallbackMgrInternalspublic void unregister(in.dragonbra.javasteam.steam.steamclient.callbackmgr.CallbackBase callback)
unregister in interface ICallbackMgrInternals