This repository was archived by the owner on Nov 8, 2023. It is now read-only.
File tree 2 files changed +25
-7
lines changed
2 files changed +25
-7
lines changed Original file line number Diff line number Diff line change @@ -44,8 +44,18 @@ impl<'a> KafkaPayload<'a> {
44
44
}
45
45
}
46
46
}
47
- impl < ' a > Clone for KafkaPayload < ' a > {
48
- fn clone ( & self ) -> KafkaPayload < ' a > {
47
+ // impl<'a> Clone for KafkaPayload<'a> {
48
+ // fn clone(&self) -> KafkaPayload<'a> {
49
+ // match self {
50
+ // Self::Borrowed(ref msg) => Self::Owned(msg.detach()),
51
+ // Self::Owned(ref msg) => Self::Owned(msg.clone()),
52
+ // }
53
+ // }
54
+ // }
55
+
56
+ impl ToOwned for KafkaPayload < ' static > {
57
+ type Owned = KafkaPayload < ' static > ;
58
+ fn to_owned ( & self ) -> KafkaPayload < ' static > {
49
59
match self {
50
60
Self :: Borrowed ( ref msg) => Self :: Owned ( msg. detach ( ) ) ,
51
61
Self :: Owned ( ref msg) => Self :: Owned ( msg. clone ( ) ) ,
Original file line number Diff line number Diff line change @@ -112,12 +112,20 @@ impl<'a> StreamProcessor<'a> {
112
112
} else {
113
113
// Otherwise, we need to try fetch a new message from the consumer,
114
114
// even if there is no active assignment and/or processing strategy.
115
- let msg = self . consumer . poll ( Some ( Duration :: from_secs ( 1 ) ) ) ;
115
+ let msg = self
116
+ . consumer
117
+ . poll ( Some ( Duration :: from_secs ( 1 ) ) )
118
+ . unwrap ( )
119
+ . unwrap ( )
120
+ . to_owned ( ) ;
121
+
122
+ self . message = Some ( msg)
123
+
116
124
//TODO: Support errors properly
117
- match msg {
118
- Ok ( m) => self . message = m,
119
- Err ( _) => return Err ( RunError :: PollError ) ,
120
- }
125
+ // match msg {
126
+ // Ok(m) => self.message = m,
127
+ // Err(_) => return Err(RunError::PollError),
128
+ // }
121
129
}
122
130
123
131
let mut trait_callbacks = self . strategies . lock ( ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments