Prefer a directory row's nodeKey for resourceKey.
const rows = yield* directory.nodesServing(...)
yield* Lookup.preferEntry(Worker.key, rows[0]!)export const const preferEntry: (
resourceKey: string,
entry: { readonly nodeKey: string }
) => Effect.Effect<string, never, Advice>
Prefer a directory row's nodeKey for resourceKey.
const rows = yield* directory.nodesServing(...)
yield* Lookup.preferEntry(Worker.key, rows[0]!)
preferEntry = (
resourceKey: stringresourceKey: string,
entry: {
readonly nodeKey: string
}
entry: { readonly 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, prefer: stringprefer: entry: {
readonly nodeKey: string
}
entry.nodeKey: stringnodeKey });