@otpjs/supervisor
@otpjs/supervisor
npm i @otpjs/supervisor
@otpjs/supervisor

@otpjs/supervisor

An implementation of the Open Telecom Platform in Javascript

by otp-js

0.17.7 (see all)License:MITTypeScript:Not Found
npm i @otpjs/supervisor
Readme

supervisor

A limited OTP supervisor implementation.

Currently supported strategies include:

  • one_for_one
  • simple_one_for_one

Install

npm i @otpjs/supervisor

Usage

import * as supervisor from '@otpjs/supervisor';
import * as argumentServer from './arguments';
import * as numberServer from './numbers';

const callbacks = {init};

export function startLink(ctx, arg) {
    return supervisor.startLink(ctx, callbacks, [arg, 123])
}

function init(ctx, arg, number) {
    return [
        ok,
        [
            {strategy: one_for_one},
            [
                {
                    id: 'arg-processor',
                    start: [argumentServer.startLink, [arg]]
                },
                {
                    id: 'number-processor',
                    start: [numberServer.startLink, [number]]
                }
            ]
        ]
    ]
}

Downloads/wk

633

GitHub Stars

12

LAST COMMIT

9mos ago

MAINTAINERS

1

CONTRIBUTORS

1

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
0.17.7
latest
10d ago
0.10.0-beta.21
beta
8mos ago
No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

100
No reviews found
Be the first to rate