CallbackManager

class CallbackManager(steamClient: SteamClient)

This class is a utility for routing callbacks to function calls. In order to bind callbacks to functions, an instance of this class must be created for the SteamClient instance that will be posting callbacks.

Parameters

steamClient

The SteamClient instance to handle the callbacks of.

Constructors

Link copied to clipboard
constructor(steamClient: SteamClient)

Initializes a new instance of the CallbackManager class.

Functions

Link copied to clipboard

Runs a single queued callback. If no callback is queued, this method will instantly return.

Link copied to clipboard

Blocks the current thread to run all queued callbacks. If no callback is queued, the method will block for the given timeout or until a callback becomes available. This method returns once the queue has been emptied.

Link copied to clipboard
suspend fun runWaitCallbackAsync()
Link copied to clipboard

Blocks the current thread to run a single queued callback. If no callback is queued, the method will block until one becomes available.

Blocks the current thread to run a single queued callback. If no callback is queued, the method will block for the given timeout or until a callback becomes available.

Link copied to clipboard
inline fun <TCallback : CallbackMsg> subscribe(callbackFunc: Consumer<TCallback>): Closeable
inline fun <TCallback : CallbackMsg> subscribe(jobID: JobID = JobID.INVALID, noinline callbackFunc: (TCallback) -> Unit): Closeable

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

Registers the provided Consumer to receive callbacks of type TCallback

Link copied to clipboard

Registers a callback to receive service notifications from Steam's unified messaging system.

Link copied to clipboard

fun <TService : UnifiedService, TNotification : GeneratedMessage.Builder<TNotification>> subscribeServiceResponse(serviceClass: Class<TService>, notificationClass: Class<TNotification>, callbackFunc: Consumer<ServiceMethodResponse<TNotification>>): Closeable

Registers a callback to receive service responses from Steam's unified messaging system.