JS.Popcorn.Genserver (Popcorn v0.4.0-next.3)

View Source

Summary

Functions

Calls a GenServer by registered name or Pid and waits for its reply.

Sends a cast through the proxy.

Functions

async call(target, request?, opts?)

@spec async call(target: string | Pid, request?: unknown, opts?: CallOpts): Promise<Result<unknown>>

Calls a GenServer by registered name or Pid and waits for its reply.

Requires a running Popcorn.Proxy, registered as popcorn_proxy by default.

Parameters

  • opts - timeoutMs defaults to 5 000 ms. proxy allows to select another registered proxy.

Returns

A Result with the reply or a bridge, VM, timeout, or GenServer error.

GenServer failures use genserver:noproc, genserver:exit, or genserver:unserializable. A call timeout does not cancel server work.

async cast(target, request?, opts?)

@spec async cast(target: string | Pid, request?: unknown, opts?: {
  proxy?: string;
}): Promise<Result<null>>

Sends a cast through the proxy.

Success confirms delivery to the proxy

Parameters

  • opts - proxy allows to select another registered proxy.

See

call