Skip to content
Liminal

Client Calls

Client.fn(...) invokes a named external method from the client protocol.

.(function* () {
  yield* .("Move")({
    : [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 failure schema
  • ConnectionError if the transport fails
  • AuditionError if the client connects to an actor that does not match its client type
  • UnresolvedError if 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.

.(function* () {
  yield* .
})

This is useful when application state changes in a way that makes the current transport session stale, such as logout or tenant switching.