asaskevich / EventBus

[Go] Lightweight eventbus with async compatibility for Go
MIT License
1.74k stars 220 forks source link

Fixed SubscribeOnce unsubscribe handling #48

Open towe75 opened 3 years ago

towe75 commented 3 years ago

SubscribeOnce removal was not reliable in the case that more then one SubscribeOnce handler is registered. The problem is simple to reproduce by running the changed unit test against the unpatched version.

codecov-io commented 3 years ago

Codecov Report

Merging #48 (22e0eb3) into master (49d4230) will decrease coverage by 1.57%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #48      +/-   ##
==========================================
- Coverage   83.26%   81.69%   -1.58%     
==========================================
  Files           4        4              
  Lines         251      213      -38     
==========================================
- Hits          209      174      -35     
+ Misses         29       26       -3     
  Partials       13       13              
Impacted Files Coverage Δ
event_bus.go 93.58% <100.00%> (-1.21%) :arrow_down:
network_bus.go 76.66% <0.00%> (-2.75%) :arrow_down:
server.go 72.13% <0.00%> (-1.79%) :arrow_down:
client.go 77.27% <0.00%> (+0.34%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 49d4230...22e0eb3. Read the comment docs.