Add Faktory Enterprise Batch API support#441
Open
Otanikotani wants to merge 5 commits intojbielick:mainfrom
Open
Add Faktory Enterprise Batch API support#441Otanikotani wants to merge 5 commits intojbielick:mainfrom
Otanikotani wants to merge 5 commits intojbielick:mainfrom
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Prevents calling jobs() on a reopened batch from creating a duplicate batch on the server. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
|
Hello @jbielick ! I want to apologize from the get go about submitting AI-assisted pull request. Please let me know if this is not something you would even consider to be added to the repository. This PR adds .batch() functionality to node version. I tried to copy https://github.com/contribsys/faktory_worker_go for what I could. I am definitely not an expert in this, but our company uses node and we do want batching. We have something done internally already to address this, but I was thinking to share it and make it available to all. Please let me know if something is off here! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for Faktory Enterprise Batches, mirroring the Go client's batch API.
Batchclass with lifecycle management (jobs(),push(),commit(),reopened())batch(),batchNew(),batchOpen(),batchCommit(),batchStatus()faktorymodule alongside existingMutation,Job, etc.Usage
Wire protocol
batchNew(batch)BATCH NEW <json>batchOpen(bid)BATCH OPEN <bid>batchCommit(bid)BATCH COMMIT <bid>batchStatus(bid)BATCH STATUS <bid>Test plan
toJSON()serializes callback jobs correctlypush()throws if batch not openedpush()throws if already committedcommit()throws if already committedjobs()throws if called twicepush()setscustom.bidon jobjobs()sends BATCH NEW → PUSH → BATCH COMMIT in orderbatchOpenreturns usable batch for reopeningbatchStatusreturns parsed status object🤖 Generated with Claude Code