Skip to content
This repository was archived by the owner on Dec 31, 2025. It is now read-only.
This repository was archived by the owner on Dec 31, 2025. It is now read-only.

Is PublishAsync non blocking all the time? #210

@huangjunwen

Description

@huangjunwen

I was assuming PublishAsync is non-blocking. But read this in publishAsync:

// Use the buffered channel to control the number of outstanding acks.
pac <- struct{}{}

Then there is chance PublishAysnc being blocked. I would suggest changing to die fast here:

select {
  case pac <- struct{}{}:
  default:
    // Some cleanup
    return ErrMaxInFlight
}

Application can choose to publish again or just abandon.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions