-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GITBOOK-189: change request with no subject merged in GitBook
- Loading branch information
1 parent
571b417
commit 56e578b
Showing
2 changed files
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Sandboxes for groups | ||
|
||
It is also possible to use [Sandboxes](../../guide/workers/sandboxed-processors.md) for processing groups. It works essentially the same as in standard BullMQ, but you gain access to the "gid" property in the job object sent to your processor, for example: | ||
|
||
```typescript | ||
module.exports = function (job: SandboxedJobPro) { | ||
expect(job).to.have.property('gid'); | ||
expect(job.opts).to.have.property('group'); | ||
expect(job.opts.group).to.have.property('id'); | ||
expect(job.opts.group.id).to.be.a('string'); | ||
expect(job.opts.group.id).to.equal(job.gid); | ||
}; | ||
``` |