LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
React SDK
Vue SDK
Svelte SDK
Angular SDK
LangGraph SDK
  • Ui
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Utils
  • Server
  • Stream
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
  • Store
LangGraph Checkpoint Redis
  • Shallow
  • Store
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
  • Cli
LangGraph API
LangGraph CLI
LangGraph CUA
  • Utils
LangGraph Supervisor
LangGraph Swarm
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangGraph
WebChannelsPregelPrebuiltRemote
React SDK
Vue SDK
Svelte SDK
Angular SDK
LangGraph SDK
UiClientAuthReactLoggingReact UiUtilsServerStream
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
Store
LangGraph Checkpoint Redis
ShallowStore
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
Cli
LangGraph API
LangGraph CLI
LangGraph CUA
Utils
LangGraph Supervisor
LangGraph Swarm
Language
Theme
JavaScript@langchain/langgraph-sdkstreamChannelRegistryacquire
Method●Since v2.0

acquire

Acquire a ref-counted projection.

If no entry exists for spec.key, one is created (allocating a StreamStore seeded with spec.initial) and — when a thread is currently bound — its runtime is opened immediately. If an entry already exists, its ref count is incremented and the existing store is returned.

The returned release() is idempotent: calling it more than once is a no-op. When the ref count drops to zero, the entry is removed and its runtime disposed (best-effort, never throws into callers).

Safe to call from any framework lifecycle hook. Subsequent calls for the same spec.key always return the same store reference for the lifetime of the controller, so consumers can rely on store identity.

Copy
acquire<T>(spec: ProjectionSpec<T>): AcquiredProjection<T>

Parameters

NameTypeDescription
spec*ProjectionSpec<T>

Projection contract; the registry keys off spec.key.

View source on GitHub