How to use the @terascope/teraslice-messaging.ExecutionController 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 / execution-controller / index.js View on Github external
const ms = require('ms');
const _ = require('lodash');
const Messaging = require('@terascope/teraslice-messaging');
const {
    TSError, get, pDelay, getFullErrorStack, logError, pWhile
} = require('@terascope/utils');
const { waitForWorkerShutdown } = require('../helpers/worker-shutdown');
const { makeStateStore, makeExStore, SliceState } = require('../../storage');
const { makeLogger, generateWorkerId } = require('../helpers/terafoundation');
const ExecutionAnalytics = require('./execution-analytics');
const makeSliceAnalytics = require('./slice-analytics');
const Scheduler = require('./scheduler');
const Metrics = require('../metrics');

const ExecutionControllerServer = Messaging.ExecutionController.Server;
const ClusterMasterClient = Messaging.ClusterMaster.Client;
const { formatURL } = Messaging;

class ExecutionController {
    constructor(context, executionContext) {
        const workerId = generateWorkerId(context);
        const logger = makeLogger(context, 'execution_controller');
        const events = context.apis.foundation.getSystemEvents();
        const slicerPort = executionContext.config.slicer_port;
        const performanceMetrics = executionContext.config.performance_metrics;
        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 nodeDisconnectTimeout = get(config, 'node_disconnect_timeout');
        const shutdownTimeout = get(config, 'shutdown_timeout');

@terascope/teraslice-messaging

An internal teraslice messaging library using socket.io

Apache-2.0
Latest version published 17 days ago

Package Health Score

70 / 100
Full package analysis