Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/willow/src/wgps/handle_store.ts>HandleStore

Exploring Willow in the most efficient and sound programming language
Go to Latest
class HandleStore
import { HandleStore } from "https://deno.land/x/willow@0.2.1/src/wgps/handle_store.ts";

A mapping of handles to data

Properties

private
eventuallyMap: Map<bigint, Deferred<ValueType>>
private
leastUnassignedHandle: bigint
private
map: Map<bigint, [ValueType, boolean, number]>

A map of handles (numeric IDs) to a triple made up of:

  • The bound data
  • Whether we've asked to free that data (and in doing so committing to no longer using it)
  • The number of unprocessed messages which refer to this handle.

Methods

Bind some data to a handle.

canUse(handle: bigint)
decrementHandleReference(handle: bigint)
get(handle: bigint): ValueType | undefined

Indicates whether this a store of handles we have bound, or a store of handles bound by another peer.

getEventually(handle: bigint): Promise<ValueType>
incrementHandleReference(handle: bigint)
markForFreeing(handle: bigint)
update(handle: bigint, data: ValueType)

Update the data at some binding

[Symbol.iterator](): Iterator<[bigint, ValueType]>