(
resource: string | { readonly key: string },
nodeKey: string
): Effect.Effect<string, never, Advice>Prefer nodeKey when dialing resource (Tag or key string).
Coordinator sugar over advise — algorithms stay app-owned.
yield* Lookup.prefer(Worker, "fleet/Worker#w2")export const const prefer: (
resource: string | { readonly key: string },
nodeKey: string
) => Effect.Effect<string, never, Advice>
Prefer nodeKey when dialing resource (Tag or key string).
Coordinator sugar over
advise
— algorithms stay app-owned.
yield* Lookup.prefer(Worker, "fleet/Worker#w2")
prefer = (
resource: | string
| {
readonly key: string
}
resource: string | { readonly key: stringkey: string },
nodeKey: stringnodeKey: string,
): import EffectEffect.interface Effect<out A, out E = never, out R = never>The Effect interface defines a value that lazily describes a workflow or
job. The workflow requires some context R, and may fail with an error of
type E, or succeed with a value of type A.
When to use
Use when you need to represent a lazy, composable workflow that can require
services, fail with a typed error, or succeed with a typed value.
Details
Effect values model resourceful interaction with the outside world,
including synchronous, asynchronous, concurrent, and parallel interaction.
They use a fiber-based concurrency model, with built-in support for
scheduling, fine-grained interruption, structured concurrency, and high
scalability.
To run an Effect value, you need a Runtime, which is a type that is
capable of executing Effect values.
Effect<string, never, class AdviceLookup placement board — coordinator advice for nodeless /
Hyperlink.lookupClient
dial.
v1: last-write-wins, in-memory, no advisor ACL. Algorithms stay app-owned (who calls
advise
); Lookup only stores and surfaces the preference.
Advice> =>
const advise: (input: {
readonly resourceKey: string
readonly prefer: string
}) => Effect.Effect<string, never, Advice>
Publish placement advice (requires
Advice
in context).
yield* Lookup.advise({ resourceKey: Worker.key, prefer: "fleet/Worker#w2" })
advise({
resourceKey: stringresourceKey: typeof resource: | string
| {
readonly key: string
}
resource === "string" ? resource: stringresource : resource: {
readonly key: string
}
resource.key: stringkey,
prefer: stringprefer: nodeKey: stringnodeKey,
});