Client Calls
Client.fn(...) invokes a named external method from the client protocol.
Effect.gen(function* () {
yield* TicTacToeClient.fn("Move")({
position: [1, 1],
})
})The method name selects the payload, success, and failure types from the client's external table.
Failure types
The effect error type is wider than just the method's domain failure. A call can fail with:
- the method's typed
failureschema ConnectionErrorif the transport failsAuditionErrorif the client connects to an actor that does not match its client typeUnresolvedErrorif the underlying transport dies before the call resolves
Invalidate the session
Client.invalidate tears down the underlying transport session. The next use re-acquires it.
Effect.gen(function* () {
yield* TicTacToeClient.invalidate
})This is useful when application state changes in a way that makes the current transport session stale, such as logout or tenant switching.