How to use the @terascope/teraslice-messaging.formatURL function in @terascope/teraslice-messaging

To help you get started, we’ve selected a few @terascope/teraslice-messaging 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 terascope / teraslice / packages / teraslice / lib / workers / worker / index.js View on Github external
const {
            slicer_port: slicerPort,
            slicer_hostname: slicerHostname,
            performance_metrics: performanceMetrics
        } = executionContext.config;

        const config = context.sysconfig.teraslice;
        const networkLatencyBuffer = get(config, 'network_latency_buffer');
        const actionTimeout = get(config, 'action_timeout');
        const workerDisconnectTimeout = get(config, 'worker_disconnect_timeout');
        const slicerTimeout = get(config, 'slicer_timeout');
        const shutdownTimeout = get(config, 'shutdown_timeout');

        this.client = new ExecutionController.Client({
            executionControllerUrl: formatURL(slicerHostname, slicerPort),
            workerId,
            networkLatencyBuffer,
            workerDisconnectTimeout,
            // the connect timeout should be set to the same timeout that will
            // cause the execution fail if no Workers connect
            connectTimeout: slicerTimeout,
            actionTimeout,
            logger
        });

        this.slice = new Slice(context, executionContext);

        this.metrics = performanceMetrics
            ? new Metrics({
                logger
            })

@terascope/teraslice-messaging

An internal teraslice messaging library using socket.io

Apache-2.0
Latest version published 7 days ago

Package Health Score

70 / 100
Full package analysis

Similar packages