本文整理汇总了TypeScript中amqp10.Client.disconnect方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Client.disconnect方法的具体用法?TypeScript Client.disconnect怎么用?TypeScript Client.disconnect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类amqp10.Client
的用法示例。
在下文中一共展示了Client.disconnect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
receiver.on('message', message => {
console.log('received: ', message);
if (message.body.DataValue === msgVal) {
client.disconnect().then(() => {
console.log('disconnected, when we saw the value we inserted.');
process.exit(0);
});
}
});
示例2:
receiver.on('message', msg => {
console.log('Message received: ');
console.log('Number of partitions: ' + msg.body.partition_count);
console.log('Partition IDs: ' + msg.body.partition_ids);
client.disconnect().then(() => {
console.log('=== Disconnected ===');
process.exit(0);
});
});
示例3: messageHandler
function messageHandler(myIdx: number, msg: amqp.Message) {
console.log('received(' + myIdx + '): ', msg.body);
if (msg.annotations)
console.log('annotations: ', msg.annotations);
if (msg.body.DataValue === msgVal) {
client.disconnect().then(() => {
console.log('disconnected, when we saw the value we inserted.');
process.exit(0);
});
}
}
示例4:
receiver.on('message', message => {
console.log('received: ', message.body);
if (message.annotations)
console.log('annotations: ', message.annotations);
if (message.body.dataValue === msgId) {
client.disconnect().then(() => {
console.log('received expected message, disconnected.');
process.exit(0);
});
}
});