We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e6a5e47 commit ab896d7Copy full SHA for ab896d7
1 file changed
examples/repeat.rs
@@ -1,27 +1,22 @@
1
extern crate msgflo;
2
-
3
use msgflo::participant::{Participant, InfoBuilder, Info};
4
5
struct Repeat {
6
state: Option<String>, // we don't really have any state
7
}
8
9
impl Participant for Repeat {
10
fn info(&self) -> Info {
11
- InfoBuilder::new("rust/Repeat")
12
- .label("Repeats input as-is")
+ InfoBuilder::new("rust/Repeat").label("Repeats input as-is")
13
.inport("in")
14
.outport("out")
15
.build()
16
17
+ // Will be called with input AMQP data on 'in' port, and send to 'out'
18
fn process(&self, input: Vec<u8>) -> Result<Vec<u8>, Vec<u8>> {
19
println!("repeat process():");
20
return Ok(input);
21
22
23
24
25
fn main() {
26
static r: Repeat = Repeat { state: None };
27
msgflo::participant::main(&r);
0 commit comments