Author | SHA1 | Message | Date |
---|---|---|---|
M. J. Fromberger |
441ecbaeec
|
types: rename and extend the EventData interface (#7687)
This is the interface shared by types that can be used as event data in, for example, subscriptions via the RPC. To be compatible with the RPC service, data need to support JSON encoding. Require this as part of the interface. |
3 years ago |
M. J. Fromberger |
079c7af007
|
pubsub: use concrete queries instead of an interface (#7686)
Remove the pubsub.Query interface and instead use the concrete query type. Nothing uses any other implementation but pubsub/query. * query: remove the error from the Matches method * Update all usage. |
3 years ago |
M. J. Fromberger |
82738eb016
|
Move the libs/pubsub package to internal scope (#7451)
No API changes, merely changes the import path. |
3 years ago |
M. J. Fromberger |
f7f4067968
|
pubsub: simplify and improve server concurrency handling (#7070)
Rework the internal plumbing of the server. This change does not modify the exported interfaces or semantics of the package, and all the existing tests still pass. The main changes here are to: - Simplify the interface for subscription indexing with a typed index rather than a single nested map. - Ensure orderly shutdown of channels, so that there is no longer a dynamic race with concurrent publishers & subscribers at shutdown. - Remove a layer of indirection between publishers and subscribers. This mainly helps legibility. - Remove order dependencies between registration and delivery. - Add documentation comments where they seemed helpful, and clarified the existing comments where it was practical. Although performance was not a primary goal of this change, the simplifications did very slightly reduce memory use and increase throughput on the existing benchmarks, though the delta is not statistically significant. BENCHMARK BEFORE AFTER SPEEDUP (%) B/op (B) B/op (A) Benchmark10Clients-12 5947 5566 6.4 2017 1942 Benchmark100Clients-12 6111 5762 5.7 1992 1910 Benchmark1000Clients-12 6983 6344 9.2 2046 1959 |
3 years ago |