good morning!!!!

Skip to content
Snippets Groups Projects
Commit 1be5f024 authored by a's avatar a
Browse files

even better logic

parent a0e58431
Branches
Tags v0.0.6
No related merge requests found
......@@ -93,9 +93,9 @@ func (s *Stream) run_send() {
for {
select {
case sb := <-s.sub:
if sub, ok := s.subs.LoadOrStore(sb.id, sb); !ok {
sub, ok := s.subs.LoadOrStore(sb.id, sb)
sub.s.OnSubscribe(last.seq, last.val)
} else {
if ok {
sb.s.CloseWith(errors.New("duplicate subscription"))
}
case n := <-s.out:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment