-
Notifications
You must be signed in to change notification settings - Fork 15
Batches and trackable jobs #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 52 commits
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
a0b2dc9
Add tracker, add support for batch jobs
rustworthy b143490
Run fmt
rustworthy 030484f
Merge branch 'main' into feat/ent-batch-jobs
rustworthy f3c8348
Use doc-cfg for new ent features
rustworthy 143319c
Merge branch 'main' into feat/ent-batch-jobs
rustworthy 268ffec
Do not error if batch does not exist when re-opening
rustworthy 6b4770c
Update batch and job names in docs
rustworthy b69ed1a
Expect no args on batch::builder
rustworthy 3e27bf1
Avoid unwraps in docs
rustworthy 1ca4159
Update src/proto/batch/mod.rs
rustworthy a8048ee
Consume batchbuilder
rustworthy 6653c50
Accept Into<String> in BatchBuilder description
rustworthy c0e0176
Default description to None
rustworthy 1cda1dd
Update src/proto/batch/mod.rs
rustworthy d3e4505
Update src/proto/batch/mod.rs
rustworthy 87bf6c7
Update src/proto/single/ent.rs
rustworthy 304f290
Update comment to 'parse_datetime' utility
rustworthy 31bef3e
Update src/proto/single/ent.rs
rustworthy f554817
Typo in 'known'
rustworthy c2db5ea
Update docs for 'reserve_until'
rustworthy effdd81
Update docs, make 'BatchHandle' public
rustworthy 7c7e1c3
Update comment in e2e test.
rustworthy c279922
Add JobState enum. Update tests accordingly
rustworthy fa906df
App 'open' method on 'BatchStatus'
rustworthy 73c11fd
Add 'set_progress' shortcut
rustworthy 2dd891f
Add 'update_percet' method
rustworthy d745549
Add 'update_percet' method
rustworthy 54f78f6
Add 'update_percet' method
rustworthy 2f7231d
Make get_random_wid and get_random_jid public within crate
rustworthy 120978b
Update tests for 'update_percent' shortcut
rustworthy 01fd744
Make jobs trackable by deafult
rustworthy c8b7450
Make jobs trackable by deafult - update tests
rustworthy 0edbd83
Add 'CallbackState' enum. Use for complete and success callback type
rustworthy 06d208e
Bring 'Tracker' into scope for docs
rustworthy e13f0d6
Update assertion on batch test
rustworthy d10ceee
Make BatchHandle::add return option of old bid
rustworthy ff3fd5f
Make BatchHandle::add return option of old bid as serde_json::Value
rustworthy 489ca0f
Run formatter
rustworthy 18f1593
Double-check the batch callback status
rustworthy 1dfb8d1
Restore assertions after verifying on CI
rustworthy 0958e31
Update src/producer/mod.rs
rustworthy e2f57b6
Update src/proto/single/ent.rs
rustworthy 0d721cf
Update src/proto/single/mod.rs
rustworthy 5bd8616
Update import grouping in producer module
rustworthy c9c8bd0
Turn free func 'set_progress' into unbound set of ProgressUpdate
rustworthy 1560c21
Add comment to batch guarantees subtest
rustworthy 4fd12a6
Rm Tracker construct
rustworthy 07ab901
Re-use client logic
rustworthy 637a2ae
Update docs for 'is_worker'
rustworthy c7d7d62
make checks pass
rustworthy 629e6b1
Fix PR review threads
rustworthy c1a82fc
Split single::ent mod
rustworthy 50ef9c3
Update src/lib.rs
rustworthy fde63fc
Update src/proto/mod.rs
rustworthy 62da8fd
Update src/proto/mod.rs
rustworthy 9bd191c
Update src/proto/mod.rs
rustworthy 8a87e50
Update src/proto/mod.rs
rustworthy fb56236
Update src/proto/mod.rs
rustworthy 6ce6bc0
Update src/proto/mod.rs
rustworthy 1dd3981
Update imports in faktory ent tests
rustworthy 65ac269
Run cargo fmt
rustworthy f8dae7d
Update docs
rustworthy 80749d4
Merge branch 'main' into feat/ent-batch-jobs
jonhoo 6c98127
Remove group imports format checking
jonhoo 62ec997
nit on module ordering
jonhoo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| use crate::proto::single::FaktoryCommand; | ||
| use crate::{Batch, Error}; | ||
| use std::io::Write; | ||
|
|
||
| impl FaktoryCommand for Batch { | ||
| fn issue<W: Write>(&self, w: &mut W) -> Result<(), Error> { | ||
| w.write_all(b"BATCH NEW ")?; | ||
| serde_json::to_writer(&mut *w, self).map_err(Error::Serialization)?; | ||
| Ok(w.write_all(b"\r\n")?) | ||
| } | ||
| } | ||
|
|
||
| // ---------------------------------------------- | ||
|
|
||
| pub struct CommitBatch(String); | ||
|
|
||
| impl From<String> for CommitBatch { | ||
| fn from(value: String) -> Self { | ||
| CommitBatch(value) | ||
| } | ||
| } | ||
|
|
||
| impl FaktoryCommand for CommitBatch { | ||
| fn issue<W: Write>(&self, w: &mut W) -> Result<(), Error> { | ||
| w.write_all(b"BATCH COMMIT ")?; | ||
| w.write_all(self.0.as_bytes())?; | ||
| Ok(w.write_all(b"\r\n")?) | ||
| } | ||
| } | ||
|
|
||
| // ---------------------------------------------- | ||
|
|
||
| pub struct GetBatchStatus(String); | ||
|
|
||
| impl From<String> for GetBatchStatus { | ||
| fn from(value: String) -> Self { | ||
| GetBatchStatus(value) | ||
| } | ||
| } | ||
|
|
||
| impl FaktoryCommand for GetBatchStatus { | ||
| fn issue<W: Write>(&self, w: &mut W) -> Result<(), Error> { | ||
| w.write_all(b"BATCH STATUS ")?; | ||
| w.write_all(self.0.as_bytes())?; | ||
| Ok(w.write_all(b"\r\n")?) | ||
| } | ||
| } | ||
|
|
||
| // ---------------------------------------------- | ||
|
|
||
| pub struct OpenBatch(String); | ||
|
|
||
| impl From<String> for OpenBatch { | ||
| fn from(value: String) -> Self { | ||
| OpenBatch(value) | ||
| } | ||
| } | ||
|
|
||
| impl FaktoryCommand for OpenBatch { | ||
| fn issue<W: Write>(&self, w: &mut W) -> Result<(), Error> { | ||
| w.write_all(b"BATCH OPEN ")?; | ||
| w.write_all(self.0.as_bytes())?; | ||
| Ok(w.write_all(b"\r\n")?) | ||
| } | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.