contribsys / faktory

Language-agnostic persistent background job server
https://contribsys.com/faktory/
Other
5.78k stars 230 forks source link

Allow batches to push jobs in bulk #437

Closed Tylerian closed 10 months ago

Tylerian commented 1 year ago

Context

Faktory 1.6.0 introduced the BULKB command which allows jobs to be pushed in bulk, and the Faktory Client introduced the PushBulk method in order to add support for it.

Problem

Although the feature should also work with Batches out of the box, currently the Faktory Client's Batch API doesn't implement the PushBulk functionality.

Solution

This MR adds the PushBulk method to Faktory's Client Batch API in order to allow Jobs to be pushed in bulk within Batches.

mperham commented 1 year ago

Needs tests.

Tylerian commented 1 year ago

Needs tests.

Sorry for that. Just wanted to follow the conventions of the project. Is there any existing file Batch specific tests are placed? I couldn't find any. If not, I'll create a new batch_test.go file following Golang conventions and place them there.

mperham commented 1 year ago

Sorry for the lack of detail. I know that faktory_worker_ruby has some batch tests, as does faktory_worker_go. You might need to create two PRs, one to add the APIs to the client package (this PR) and the other to add a test to fwg. It's not really possible to test Enterprise functionality in this repo.

If you know Ruby and use FWR, you're welcome to add the same functionality and test there since the Ruby client and tests are in the same repo.