Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

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 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.

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.