How to use the diagnostic-channel.channel.unsubscribe function in diagnostic-channel

To help you get started, we’ve selected a few diagnostic-channel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / node-diagnostic-channel / src / publisher-legacy-tests / pg6 / pg6.spec.ts View on Github external
}).then(() => {
            assert.equal(events, 6, "subscriber called too many times");
            assert.equal(handlers, 5, "callback called too many times");
            channel.unsubscribe("postgres", counter);
        }).then(done, done);
    });
github microsoft / node-diagnostic-channel / src / publisher-legacy-tests / pg6 / pg6.spec.ts View on Github external
afterEach((done) => {
        channel.unsubscribe("postgres", listener);
        actual = null;
        client.end(done);
    });
github microsoft / ApplicationInsights-node.js / AutoCollection / diagnostic-channel / mysql.sub.ts View on Github external
export function enable(enabled: boolean, client: Client) {
    if (enabled) {
        if (clients.length === 0) {
            channel.subscribe("mysql", subscriber);
        };
        clients.push(client);
    } else {
        clients = clients.filter((c) => c != client);
        if (clients.length === 0) {
            channel.unsubscribe("mysql", subscriber);
        }
    }
}
github microsoft / ApplicationInsights-node.js / AutoCollection / diagnostic-channel / postgres.sub.ts View on Github external
export function enable(enabled: boolean, client: TelemetryClient) {
    if (enabled) {
        if (clients.length === 0) {
            channel.subscribe("postgres", subscriber);
        };
        clients.push(client);
    } else {
        clients = clients.filter((c) => c != client);
        if (clients.length === 0) {
            channel.unsubscribe("postgres", subscriber);
        }
    }
}
github microsoft / ApplicationInsights-node.js / AutoCollection / diagnostic-channel / mongodb.sub.ts View on Github external
export function enable(enabled: boolean, client: TelemetryClient) {
    if (enabled) {
        if (clients.length === 0) {
            channel.subscribe("mongodb", subscriber);
        };
        clients.push(client);
    } else {
        clients = clients.filter((c) => c != client);
        if (clients.length === 0) {
            channel.unsubscribe("mongodb", subscriber);
        }
    }
}
github microsoft / ApplicationInsights-node.js / AutoCollection / diagnostic-channel / console.sub.ts View on Github external
export function dispose() {
    channel.unsubscribe("console", subscriber);
    clients = [];
}
github microsoft / ApplicationInsights-node.js / AutoCollection / diagnostic-channel / redis.sub.ts View on Github external
export function enable(enabled: boolean, client: Client) {
    if (enabled) {
        if (clients.length === 0) {
            channel.subscribe("redis", subscriber);
        };
        clients.push(client);
    } else {
        clients = clients.filter((c) => c != client);
        if (clients.length === 0) {
            channel.unsubscribe("redis", subscriber);
        }
    }
}
github microsoft / ApplicationInsights-node.js / AutoCollection / diagnostic-channel / winston.sub.ts View on Github external
export function enable(enabled: boolean, client: TelemetryClient) {
    if (enabled) {
        if (clients.length === 0) {
            channel.subscribe("winston", subscriber);
        };
        clients.push(client);
    } else {
        clients = clients.filter((c) => c != client);
        if (clients.length === 0) {
            channel.unsubscribe("winston", subscriber);
        }
    }
}
github microsoft / ApplicationInsights-node.js / AutoCollection / diagnostic-channel / winston.sub.ts View on Github external
export function dispose() {
    channel.unsubscribe("winston", subscriber);
    clients = [];
}
github microsoft / ApplicationInsights-node.js / AutoCollection / diagnostic-channel / azure-coretracing.sub.ts View on Github external
export function enable(enabled: boolean, client: TelemetryClient) {
    if (enabled) {
        if (clients.length === 0) {
            channel.subscribe("azure-coretracing", subscriber);
        };
        clients.push(client);
    } else {
        clients = clients.filter((c) => c != client);
        if (clients.length === 0) {
            channel.unsubscribe("azure-coretracing", subscriber);
        }
    }
}

diagnostic-channel

Provides a context-saving pub/sub channel to connect diagnostic event publishers and subscribers

MIT
Latest version published 1 year ago

Package Health Score

74 / 100
Full package analysis

Similar packages