Skip to content

Commit

Permalink
Merge pull request #272 from ankitK1987/feature/pushb
Browse files Browse the repository at this point in the history
Feature/pushb
  • Loading branch information
jbielick authored Mar 17, 2022
2 parents a1ae91a + a6650df commit cfe7c7e
Show file tree
Hide file tree
Showing 5 changed files with 209 additions and 33 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,24 @@ const faktory = require("faktory-worker");

A job is a payload of keys and values according to [the faktory job payload specification](https://github.com/contribsys/faktory/wiki/The-Job-Payload). Any keys provided will be passed to the faktory server during `PUSH`. A `jid` (uuid) is created automatically for your job when using this library. See [the spec](https://github.com/contribsys/faktory/wiki/The-Job-Payload) for more options and defaults.

### Pushing bulk jobs

```js
const faktory = require("faktory-worker");

(async () => {
const client = await faktory.connect();
let job1 = client.job("ResizeImage", { id: 333, size: "thumb" });
let job2 = client.job("ResizeImage", { id: 334, size: "thumb" });
let response = await client.bulkPush([job1, job2]);
//Handle Response
await client.close(); // reuse client if possible! remember to disconnect!
})().catch((e) => console.error(e));
```
faktory link:
[https://github.com/contribsys/faktory/blob/main/Changes.md#160](url)


### Processing jobs

```js
Expand Down
Loading

0 comments on commit cfe7c7e

Please sign in to comment.