-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Test spans * Fix following from the shared process span * Use beta of tracing-capture
- Loading branch information
1 parent
35af5d0
commit e6fc44d
Showing
8 changed files
with
198 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
/target | ||
/Cargo.lock | ||
|
||
.vscode | ||
|
||
tmp |
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
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
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
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,29 @@ | ||
use std::time::Duration; | ||
|
||
use async_trait::async_trait; | ||
use batch_aint_one::{Batcher, Processor}; | ||
|
||
#[derive(Debug, Clone)] | ||
pub struct SimpleBatchProcessor(pub Duration); | ||
|
||
#[async_trait] | ||
impl Processor<String, String, String> for SimpleBatchProcessor { | ||
async fn process( | ||
&self, | ||
key: String, | ||
inputs: impl Iterator<Item = String> + Send, | ||
) -> Result<Vec<String>, String> { | ||
tokio::time::sleep(self.0).await; | ||
Ok(inputs.map(|s| s + " processed for " + &key).collect()) | ||
} | ||
} | ||
|
||
struct NotCloneable {} | ||
type Cloneable = Batcher<String, NotCloneable, NotCloneable>; | ||
|
||
/// A [Batcher] should be cloneable, even when the `I`s and `O`s are not. | ||
#[derive(Clone)] | ||
#[allow(unused)] | ||
struct CanDeriveClone { | ||
batcher: Cloneable, | ||
} |