!refactored session to WithAdapter based to propery run many connections on the server

This commit is contained in:
sergeych committed 2022-09-28 00:19:07 +03:00
1 parent f455f2b955
commit 07f9e720a1
10 files changed
+33 -30

No files matched your search

@@ -13,7 +13,7 @@ class CommandDescriptor<A, R>(
@Suppress("UNCHECKED_CAST")
suspend operator fun invoke(adapter: Adapter<*>): R = adapter.invokeCommand(this,Unit as A)
operator fun <I>invoke(commandHost: CommandHost<I>, block: suspend I.(A)->R) {
operator fun <I: WithAdapter>invoke(commandHost: CommandHost<I>, block: suspend I.(A)->R) {
commandHost.on(this, block)
}
}