Agora

Flags 1.x is a release candidate. npm's latest tag still installs 0.x, so install these docs' version from the rc tag:

npm i @adonis-agora/flags@rc
node ace configure @adonis-agora/flags

The same goes for every @adonis-agora/* package these docs install: add @rc, and where a page says node ace add, install with @rc first and then run node ace configure. On 0.x? Read the 0.x docs.

Deployment

Where background work runs — in your web processes, as durable workflows, or in a separate worker.

The background work — relaying events to sinks, running scheduled changes, computing experiment results, pruning the log — is safe to run on many replicas at once. Two options decide where it runs: role and dispatcher, the same vocabulary as the other Agora libraries.

dispatcher

ValueBackground work runs
auto (default)As durable workflows when @adonis-agora/durable's provider is registered, otherwise in process
durableAs durable workflows (fails at boot without durable). Each run, error and retry is in the durable console
in-processOn a timer in every web/worker process

role

ValueThis process
all (default)Serves requests and runs background work
apiServes requests only
workerRuns background work only (no control-plane routes)

A separate worker

config/flags.ts
role: env.get('FLAGS_ROLE', 'all'),

Run web processes with FLAGS_ROLE=api, and one process with:

node ace flags:work            # stays up
node ace flags:work --once     # one pass, for a cron job
node ace flags:work --sink=archive

Several workers are fine: each sink is leased to one of them at a time, and each scheduled change is claimed by one.

On this page

Partner

Your product as the official integration for Flags, right here.

Become a partner →