Skip to content

Commit

Permalink
update session comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jxsl13 committed Mar 15, 2024
1 parent 5b8a69c commit b773bf3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pool/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const (
notImplemented = 540
)

// Session is
// Session is a wrapper for an amqp channel.
// It MUST not be used in a multithreaded context, but only in a single goroutine.
type Session struct {
name string
cached bool
Expand Down Expand Up @@ -363,6 +364,9 @@ func (s *Session) AwaitConfirm(ctx context.Context, expectedTag uint64) error {
}

select {
// TODO: this might lead to problems when a single session is used
// in a multithreaded context. That way we might received out of order confirmations
// which could lead to unexpected behavior.
case confirm, ok := <-s.confirms:
if !ok {
err := s.error()
Expand Down

0 comments on commit b773bf3

Please sign in to comment.