Skip to content

Commit 14f174e

Browse files
committed
Improve: cancel passed to full_snapshot() should be static
1 parent d2970fe commit 14f174e

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

examples/raft-kv-memstore-generic-snapshot-data/src/network.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl RaftNetwork<TypeConfig> for Connection {
5555
&mut self,
5656
vote: Vote<NodeId>,
5757
snapshot: Snapshot<TypeConfig>,
58-
_cancel: impl Future<Output = ReplicationClosed> + OptionalSend,
58+
_cancel: impl Future<Output = ReplicationClosed> + OptionalSend + 'static,
5959
_option: RPCOption,
6060
) -> Result<SnapshotResponse<NodeId>, typ::StreamingError<typ::Fatal>> {
6161
let resp = self

examples/raft-kv-memstore-opendal-snapshot-data/src/network.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl RaftNetwork<TypeConfig> for Connection {
5555
&mut self,
5656
vote: Vote<NodeId>,
5757
snapshot: Snapshot<TypeConfig>,
58-
_cancel: impl Future<Output = ReplicationClosed> + OptionalSend,
58+
_cancel: impl Future<Output = ReplicationClosed> + OptionalSend + 'static,
5959
_option: RPCOption,
6060
) -> Result<SnapshotResponse<NodeId>, typ::StreamingError<typ::Fatal>> {
6161
let resp = self

openraft/src/network/network.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ where C: RaftTypeConfig
9494
&mut self,
9595
vote: Vote<C::NodeId>,
9696
snapshot: Snapshot<C>,
97-
cancel: impl Future<Output = ReplicationClosed> + OptionalSend,
97+
cancel: impl Future<Output = ReplicationClosed> + OptionalSend + 'static,
9898
option: RPCOption,
9999
) -> Result<SnapshotResponse<C::NodeId>, StreamingError<C, Fatal<C::NodeId>>>;
100100

@@ -120,7 +120,7 @@ where C: RaftTypeConfig
120120
&mut self,
121121
vote: Vote<C::NodeId>,
122122
snapshot: Snapshot<C>,
123-
cancel: impl Future<Output = ReplicationClosed> + OptionalSend,
123+
cancel: impl Future<Output = ReplicationClosed> + OptionalSend + 'static,
124124
option: RPCOption,
125125
) -> Result<SnapshotResponse<C::NodeId>, StreamingError<C, Fatal<C::NodeId>>> {
126126
use crate::network::snapshot_transport::Chunked;

openraft/src/network/snapshot_transport.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub trait SnapshotTransport<C: RaftTypeConfig> {
5454
net: &mut Net,
5555
vote: Vote<C::NodeId>,
5656
snapshot: Snapshot<C>,
57-
cancel: impl Future<Output = ReplicationClosed> + OptionalSend,
57+
cancel: impl Future<Output = ReplicationClosed> + OptionalSend + 'static,
5858
option: RPCOption,
5959
) -> Result<SnapshotResponse<C::NodeId>, StreamingError<C, Fatal<C::NodeId>>>
6060
where
@@ -103,7 +103,7 @@ where C::SnapshotData: tokio::io::AsyncRead + tokio::io::AsyncWrite + tokio::io:
103103
net: &mut Net,
104104
vote: Vote<C::NodeId>,
105105
mut snapshot: Snapshot<C>,
106-
mut cancel: impl Future<Output = ReplicationClosed> + OptionalSend,
106+
mut cancel: impl Future<Output = ReplicationClosed> + OptionalSend + 'static,
107107
option: RPCOption,
108108
) -> Result<SnapshotResponse<C::NodeId>, StreamingError<C, Fatal<C::NodeId>>>
109109
where
@@ -410,7 +410,7 @@ mod tests {
410410
&mut self,
411411
_vote: Vote<C::NodeId>,
412412
_snapshot: Snapshot<C>,
413-
_cancel: impl Future<Output = ReplicationClosed> + OptionalSend,
413+
_cancel: impl Future<Output = ReplicationClosed> + OptionalSend + 'static,
414414
_option: RPCOption,
415415
) -> Result<SnapshotResponse<C::NodeId>, StreamingError<C, Fatal<C::NodeId>>> {
416416
unimplemented!()

0 commit comments

Comments
 (0)