// XXX no need to spawn "rx prefilter" - just make MasterLink.Recv1() call mlink.Recv1(), check if message should be prefiltered and call Master.recvMaster1. (-> yes)
node.rxm = make(chan _RxM)
wg.Go(func(ctx context.Context) error {
defer task.Running(&ctx, "rx prefilter")(&err)
for {
req, err := mlink.Recv1()
if err != nil {
close(node.rxm)
return err
}
err = node.recvMaster1(ctx, req) // req ownership is passed in
if err != nil {
return err
}
}
})
*/
// run user code
// wg.Go(func(ctx context.Context) error {
returnf(ctx,&_MasterLink{mlink,node})
// })
// return wg.Wait()
returnf(ctx,&_MasterLink{mlink,node})
})
}
// _MasterLink represents NodeLink to master with Recv1 filtered through _MasteredNode.
// _MasterLink represents NodeLink to master with Recv1 filtered through _MasteredNode
// δstate handler.
type_MasterLinkstruct{
*neonet.NodeLink
node*_MasteredNode
}
// RecvM1 receives request from master filtered through _MasteredNode δstate handler.
// Recv1 receives request from master filtered through _MasteredNode δstate handler.
//
// Must be called only when master link is established - e.g. from under TalkMaster.