Skip to content

climba03003/fastify-bree

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

fastify-bree

Continuous Integration Package Manager CI NPM version GitHub package.json version GitHub

This plugin integrate bree with fastify to support scheduling jobs.

Disclaimer: Although this plugin add a handy method to integrate with TypeScript. It is a known issue TypeScript do not have a good support about worker_threads.

Install

npm install fastify-bree --save

yarn add fastify-bree

Usage

import Fastifybree from 'fastify-bree'
import * as path from 'path'

fastify.register(Fastifybree, {
  customOptions: {
    root: path.resolve('jobs')
  }
})

await fastify.bree.add({
  name: 'cron' // which will use the file - `process.cwd()/jobs/cron.ts`
})

Options

options.customOptions

The options which will be directly passed to bree.

import Fastifybree from 'fastify-bree'

fastify.register(Fastifybree, {
  customOptions: {
    
  }
})

See: bree

options.autoStart

This options will add a onReady hooks to start all pre-registered jobs.

import Fastifybree from 'fastify-bree'

fastify.register(Fastifybree, {
  autoStart: true
})

options.autoClose

This options will add a onClose hooks to stop all running jobs.

import Fastifybree from 'fastify-bree'

fastify.register(Fastifybree, {
  autoClose: true
})

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published