Skip to content

Latest commit

 

History

History
38 lines (24 loc) · 1.77 KB

README.md

File metadata and controls

38 lines (24 loc) · 1.77 KB

Reverb - Graphile Workers Server

This server hosts Graphile Worker runners that are responsible for managing your Postgres job queue and processing your application's Reverb workflows. These include workflows triggered by events, cron, or steps within the Reverb step functions you've defined in your codebase.

Install

This project uses node and npm. For local development, simply run:

$ npm install

Usage

Environment

To run your Graphile workers locally, you will first need to configure several environment variables in a .env file.

  • GRAPHILE_CONNECTION_STRING is for connecting with the PostgreSQL database that will host your job queue. This should be the same database to which your functions server is connected.
  • FUNCTION_SERVER_URL configures the HTTP endpoint where the workers should send JSON-RPC requests to invoke your functions. This will most likely be http://localhost:3002/calls
  • MONGO_CONNECTION_STRING is for logging event, function, job, and error data to a MongoDB database. Logging is configured with winston.

Running Graphile Worker

To initialize the Graphile workers in a development environment, run:

$ npm run dev

If the database has not yet been populated with the necessary data from your Reverb functions server codebase, your terminal will read:

Waiting for functions data to populate in the database...

Once the database is populated, your workers will be ready and able to dequeue and process jobs!