channel.unbindStore(store)
稳定性: 1 - 实验性的
¥Stability: 1 - Experimental
-
store
<AsyncLocalStorage> 要与通道解除绑定的存储。¥
store
<AsyncLocalStorage> The store to unbind from the channel. -
返回:<boolean> 如果找到存储,则为
true
,否则为false
。¥Returns: <boolean>
true
if the store was found,false
otherwise.
删除以前使用 channel.bindStore(store)
注册到此通道的消息处理程序。
¥Remove a message handler previously registered to this channel with
channel.bindStore(store)
.
import diagnostics_channel from 'node:diagnostics_channel';
import { AsyncLocalStorage } from 'node:async_hooks';
const store = new AsyncLocalStorage();
const channel = diagnostics_channel.channel('my-channel');
channel.bindStore(store);
channel.unbindStore(store);
const diagnostics_channel = require('node:diagnostics_channel');
const { AsyncLocalStorage } = require('node:async_hooks');
const store = new AsyncLocalStorage();
const channel = diagnostics_channel.channel('my-channel');
channel.bindStore(store);
channel.unbindStore(store);