Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@supertenant/superbrain / lib / binding.js
Size: Mime:
/**
 * @typedef {{[id: string]: string}} SpanLabels
 * @typedef {Object} SpanID
 * @typedef {Object} OpenSpanResult
 * @typedef {{
    spanId: SpanID
    openSpanResult: OpenSpanResult
 }} JSOpenSpanResult
 */

const process = require('node:process');
const arch = process.arch;
const platform = process.platform;

// @ts-ignore tsc can't tell the addon's declaration
let addon = require('@supertenant/superbrain-' + platform + '-' + arch);
module.exports = {
    /** @type {function(string, string): void}  */
    setenv : addon.setenv,
    /** @type {function(string, string, string, string): boolean} */
    init : addon.init,
    /** @type {function(number?): boolean} */
    shutdown : addon.shutdown,
    /** @type {function(): boolean} */
    is_serverless : addon.is_serverless,
    /** @type {function(): boolean} */
    enable_circuit_breaker : addon.enable_circuit_breaker,
    /** @type {function(): boolean} */
    is_circuit_breaker_enabled : addon.is_circuit_breaker_enabled,
    /** @type {function(string): boolean} */
    is_integration_circuit_breaker_enabled : addon.is_integration_circuit_breaker_enabled,
    /** @type {function(import('@supertenant/superconsts').BrainLogLevel, string)} */
    log : addon.log,
    /** @type {function(number, import('@supertenant/superconsts').SpanType, SpanLabels): JSOpenSpanResult?} */
    open_span : addon.open_span,
    /** @type {function(OpenSpanResult): number} */
    poll_span_action : addon.poll_span_action,
    /** @type {function(SpanID, SpanLabels): boolean} */
    close_span : addon.close_span,
    /** @type {function(SpanID): boolean} */
    _debug_has_span : addon._debug_has_span,
    /** @type {function(): boolean} */
    _debug_do_gc : addon._debug_do_gc,
    /** @type {function(): boolean} */
    _debug_print_runtime_stats : addon._debug_print_runtime_stats,
    /** @type {function(number, number, import('@supertenant/superconsts').Task): boolean} */
    create_task : addon.create_task,
    /** @type {function(number, import('@supertenant/superconsts').Task): number} */
    create_task_auto_inc : addon.create_task_auto_inc,
    /** @type {function(number): boolean} */
    finish_task : addon.finish_task,
    /** @type {function(): void} */
    print_version : addon.print_version,
    /** @type {function(): string?} */
    get_config : addon.get_config,
}