1.2.1 • Published 5 years ago

@timesphere/cforce-worker v1.2.1

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

c-force-worker-nodejs

C-force Node.js worker registration

Sample

await registerWorker({
        rabbitmqUrl: 'amqp://localhost',
        cforeApiBaseUrl: 'http://localhost',
    }, 
    {
        appId: 'file-logger',
        appVersion: '1',
        async execute(jobId: string, parameters: object, attachments: Attachment[], supervisor: Supervisor): Promise<JobResponse> {
            const content = await readableStreamToString(supervisor.getAttachment(jobId, 'problem.txt'));
            console.log(content);

            await supervisor.attachOutputFile(jobId, 'output.txt', fs.createReadStream('output.txt'));

            return {
                status: JobResponseStatus.Succeeded,
                message: '',
                details: {}
            };
        }

    })
1.2.1

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago