fn send_service( &self, msg: Wf, ctx: PeerErrCtx )

		-> Result< Pin<Box< dyn Future< Output=Result<Response<Wf>, PeerErr> > + Send >>, PeerErr >
	{
		trace!( "PubSub: Incoming Send for relayed subscribers." );

		let peer_id = ctx.peer_id;

		let mut unordered: FuturesUnordered<_> =
		{
			// Run these concurrently so that we don't have one subscriber with a full queue blocking
			// the others from receiving.
			//
			self.subscribers.lock().values().map( |sub|
			{
				let mut sub = sub.clone_box();
				let     msg = msg.clone();

				async move
				{
					debug!( "PubSub: Send to subscriber" );

					if let Err(e) = sub.send( msg ).await
					{
						error!
						(
							"PubSub (Peer id: {:?}): subscriber (id: {}, name: {:?}) fails to receive message: {}",
							peer_id, sub.id(), sub.name(), e
						);
					}
				}

			}).collect()
		};


		Ok( async move
		{
			while unordered.next().await.is_some() {}
			Ok( Response::Nothing )

		}.boxed())
	}
/// Send a message to a handler. This should take care of deserialization.
//
Send a message to a handler. This should take care of deserialization.
Send a message to a handler . This should take care of deserialization .
fn send_service( &self, msg: Wf, ctx: PeerErrCtx )
		-> Result< Pin<Box< dyn Future< Output=Result<Response<Wf>, PeerErr> > + Send >>, PeerErr >
	{
		trace!( "PubSub: Incoming Send for relayed subscribers." );
		let peer_id = ctx.peer_id;
		let mut unordered: FuturesUnordered<_> =
		{
			// Run these concurrently so that we don't have one subscriber with a full queue blocking
			// the others from receiving.
			//
			self.subscribers.lock().values().map( |sub|
			{
				let mut sub = sub.clone_box();
				let     msg = msg.clone();
				async move
				{
					debug!( "PubSub: Send to subscriber" );
					if let Err(e) = sub.send( msg ).await
					{
						error!
						(
							"PubSub (Peer id: {:?}): subscriber (id: {}, name: {:?}) fails to receive message: {}",
							peer_id, sub.id(), sub.name(), e
						);
					}
				}
			}).collect()
		};
		Ok( async move
		{
			while unordered.next().await.is_some() {}
			Ok( Response::Nothing )
		}.boxed())
	}
fn send_service ( & self , msg : Wf , ctx : PeerErrCtx ) -> Result < Pin < Box < dyn Future < Output = Result < Response < Wf > , PeerErr > > + Send > > , PeerErr > { trace ! ( " " ) ; let peer_id = ctx . peer_id ; let mut unordered : FuturesUnordered < _ > = { // Run these concurrently so that we don't have one subscriber with a full queue blocking // the others from receiving. // self . subscribers . lock ( ) . values ( ) . map ( | sub | { let mut sub = sub . clone_box ( ) ; let msg = msg . clone ( ) ; async move { debug ! ( " " ) ; if let Err ( e ) = sub . send ( msg ) . await { error ! ( " " peer_id sub id ( ) sub name ( ) e ) ; } } } ) . collect ( ) } ; Ok ( async move { while unordered . next ( ) . await . is_some ( ) { } Ok ( Response :: Nothing ) } . boxed ( ) ) }
Send a message to a handler.
Send a message to a handler .
&self
msg
Wf
ctx
PeerErrCtx
&self
msg
Wf
ctx
PeerErrCtx