wait for subscribers to complete
This commit is contained in:
parent
2ee22f5336
commit
f7a9207c7a
@ -226,11 +226,15 @@ func (s *rpcServer) createSubHandler(sb *subscriber, opts Options) broker.Handle
|
|||||||
fn = opts.SubWrappers[i-1](fn)
|
fn = opts.SubWrappers[i-1](fn)
|
||||||
}
|
}
|
||||||
|
|
||||||
go fn(ctx, &rpcPublication{
|
s.wg.Add(1)
|
||||||
topic: sb.topic,
|
go func() {
|
||||||
contentType: ct,
|
fn(ctx, &rpcPublication{
|
||||||
message: req.Interface(),
|
topic: sb.topic,
|
||||||
})
|
contentType: ct,
|
||||||
|
message: req.Interface(),
|
||||||
|
})
|
||||||
|
s.wg.Done()
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user