Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

arque

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arque

RabbitMQ based microservice framework.

  • 0.3.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

arque

A simple microservice framework based on RabbitMQ.

import Arque from 'arque';

const arque = new Arque();

arque.createWorker('echo', async message => {
  return message;
});

const echo = arque.createClient('echo');

echo('Hello World!')
  .then(message => {
    assert.equal(message, 'Hello World!');
  });

Arque

const arque = new Arque();
const arque = new Arque('amqp://localhost');
const arque = new Arque({
  uri: 'amqp://localhost',
  prefix: null
});

Options

  • uri - RabbitMQ URI. Default value is amqp://localhost.
  • prefix - Queue name prefix. Default value is null.

arque.createWorker()

Creates a worker object.

const worker = arque.createWorker('echo', async message => {
  return message;
});
const worker = arque.createWorker({
  job: 'echo',
  concurrency: 1
}, async message => {
  return message;
});
Options
  • job - Job name. Required
  • concurrency - Maximum number of jobs that can be executed concurrently. Default value is 1.

arque.createClient()

Creates a client object.

const client = arque.createClient('echo');
const client = arque.createClient({
  job: 'echo',
  timeout: 60000
});
Options
  • job - Job name
  • timeout - Timeout time in milliseconds. Default value is 60000;

arque.close()

Close RabbitMQ connection.

Worker

worker.close()

Gracefully shut down the arque worker.

Client

client.close()

Gracefully shut down the arque client.

Keywords

FAQs

Package last updated on 29 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc