Hyperlinkv0.8.0-beta.28

ShardMap

ShardMap.serveconstsrc/ShardMap.ts:647
<
  Self,
  Key extends Schema.Top,
  Value extends Schema.Top,
  Error extends Schema.Top
>(
  tag: ShardMapTag<Self, Key, Value, Error>,
  options?: ShardMapOptions
): Layer.Layer<
  | Handler<"get">
  | Handler<"size">
  | Handler<"put">
  | Handler<"delete">
  | Handler<"getLocal">
  | Handler<"putLocal">
  | Handler<"deleteLocal">
  | Handler<"sizeLocal">
  | Handler<"sizeByNode">
  | Self
  | Hyperlink.Local<Self>,
  never,
  Hyperlink.PeersId<Self> | Hyperlink.SelfNodeId<Self>
>

Serve this ShardMap and grant its local instance from one materialization — counterpart to Hyperlink.serve. Opens SQLite (:memory: by default; pass { filename } for a durable file). Requires the mesh capability:

layers & servingHyperlink.serve
Source src/ShardMap.ts:64716 lines
export const serve = <
  Self,
  Key extends Schema.Top,
  Value extends Schema.Top,
  Error extends Schema.Top,
>(
  tag: ShardMapTag<Self, Key, Value, Error>,
  options?: ShardMapOptions,
) =>
  withSqlite(
    options,
    Hyperlink.serve(
      tag,
      buildImpl(tag, options).pipe(Effect.map((impl) => asImpl(impl))),
    ),
  );