Skip to content

Commit

Permalink
make builder send again
Browse files Browse the repository at this point in the history
  • Loading branch information
Frando committed Jun 11, 2024
1 parent 2b14986 commit 9261259
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions iroh/src/node/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ const MAX_CONNECTIONS: u32 = 1024;
const MAX_STREAMS: u64 = 10;

pub(super) type ProtocolMap = Arc<RwLock<HashMap<&'static [u8], Arc<dyn Protocol>>>>;
type ProtocolBuilders<D> = Vec<(&'static [u8], Box<dyn FnOnce(Node<D>) -> Arc<dyn Protocol>>)>;
type ProtocolBuilders<D> = Vec<(
&'static [u8],
Box<dyn FnOnce(Node<D>) -> Arc<dyn Protocol> + Send + 'static>,
)>;

/// Builder for the [`Node`].
///
Expand Down Expand Up @@ -358,7 +361,7 @@ where
pub fn accept(
mut self,
alpn: &'static [u8],
protocol: impl FnOnce(Node<D>) -> Arc<dyn Protocol> + 'static,
protocol: impl FnOnce(Node<D>) -> Arc<dyn Protocol> + Send + 'static,
) -> Self {
self.protocols.push((alpn, Box::new(protocol)));
self
Expand Down

0 comments on commit 9261259

Please sign in to comment.