chore(bus):update function comments
This commit is contained in:
parent
f63a609601
commit
3ae0ec2100
1 changed files with 4 additions and 0 deletions
|
|
@ -30,6 +30,8 @@ func (mb *MessageBus) PublishInbound(msg InboundMessage) {
|
||||||
mb.inbound <- msg
|
mb.inbound <- msg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ConsumeInbound returns the next inbound message and whether the read succeeded.
|
||||||
|
// The bool is false when the context is cancelled or the channel is closed.
|
||||||
func (mb *MessageBus) ConsumeInbound(ctx context.Context) (InboundMessage, bool) {
|
func (mb *MessageBus) ConsumeInbound(ctx context.Context) (InboundMessage, bool) {
|
||||||
select {
|
select {
|
||||||
case msg, ok := <-mb.inbound:
|
case msg, ok := <-mb.inbound:
|
||||||
|
|
@ -48,6 +50,8 @@ func (mb *MessageBus) PublishOutbound(msg OutboundMessage) {
|
||||||
mb.outbound <- msg
|
mb.outbound <- msg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SubscribeOutbound returns the next outbound message and whether the read succeeded.
|
||||||
|
// The bool is false when the context is cancelled or the channel is closed.
|
||||||
func (mb *MessageBus) SubscribeOutbound(ctx context.Context) (OutboundMessage, bool) {
|
func (mb *MessageBus) SubscribeOutbound(ctx context.Context) (OutboundMessage, bool) {
|
||||||
select {
|
select {
|
||||||
case msg, ok := <-mb.outbound:
|
case msg, ok := <-mb.outbound:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue