Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bull
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 175
    • Issues 175
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OptimalBits
  • bull
  • Issues
  • #501
Closed
Open
Issue created Apr 18, 2017 by Manuel Astudillo@manastContributor

Emit global events from inside the lua scripts

Currently we emit global events using an external module disturbed: https://www.npmjs.com/package/disturbed

This means that some operation, for example adding a job to the queue, is executed atomically via a lua script but the event is not emitted until the script has returned. Emitting the event inside the lua script itself has 2 advantages, firstly, it is a bit faster since a roundtrip to the redis instance is avoided, and secondly, it reduces a bit the chances for hazards, where at least we can guarantee that the event was emitted if the operation succeeded. It also makes the code more modular, since the events are actually emitted close to their context, instead of being emitted in an arbitrary place in javascript land.

Assignee
Assign to
Time tracking