Added back a/syncSuspend

This commit is contained in:
Robinson 2023-09-05 23:38:53 +02:00
parent 48f1555ace
commit ae5a48b309
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
1 changed files with 23 additions and 0 deletions

View File

@ -59,6 +59,17 @@ interface RemoteObject<T> {
fun async(action: T.() -> Unit)
/**
* Sets the ASYNC behavior when invoking remote methods, for whichever remote methods are in the unit function. THIS IS CONCURRENT/THREAD SAFE!
* The primary use-case for this, is when calling the RMI methods of a different type (sync/async) than is currently configured
* for this connection via the initial setting of `async` (default is false)
*
* For these methods, invoking thread WILL NOT wait for a response. The method will return immediately and the return value
* should be ignored.
*/
suspend fun asyncSuspend(action: suspend T.() -> Unit)
/**
* Sets the SYNC behavior when invoking remote methods, for whichever remote methods are in the unit function. THIS IS CONCURRENT/THREAD SAFE!
* The primary use-case for this, is when calling the RMI methods of a different type (sync/async) than is currently configured
@ -71,6 +82,18 @@ interface RemoteObject<T> {
fun sync(action: T.() -> Unit)
/**
* Sets the SYNC behavior when invoking remote methods, for whichever remote methods are in the unit function. THIS IS CONCURRENT/THREAD SAFE!
* The primary use-case for this, is when calling the RMI methods of a different type (sync/async) than is currently configured
* for this connection via the initial setting of `async` (default is false)
*
* For these methods, the invoking thread WILL wait for a response or timeout.
*
* If the return value or an exception needs to be retrieved, then DO NOT set async=true, and change the response timeout to 0 instead
*/
suspend fun syncSuspend(action: suspend T.() -> Unit)
/**
* Permits calls to [Object.toString] to actually return the `toString()` method on the object.
*