allow easy testing of other services with memory broker
and also allows to more deeply simulate real brokers
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
* provide broker disconnect messages in server
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
* broker/eats: another fix
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
* the mega cruft proxy PR
* Rename broker id
* add protocol=grpc
* fix compilation breaks
* Add the tunnel broker to the network
* fix broker id
* continue to be backwards compatible in the protocol
* PoC: memory registry using maps instead of slice madness
* Updated proto and handlers. Fixed tests across codebase.
* Implemented ttl pruning for memory registry
* Added extensive memory registry tests
* Squased a bunch of bugs
* Proto indent; memory.Registry.String() returns "memory"
* Write a test to prove memory registry TTLs are busted
Signed-off-by: Erik Hollensbe <github@hollensbe.org>
* Additional memory testing and fixups:
* DefaultTTL removed
* When TTL == 0, it is automatically removed from expiry conditions
* Additional improvements to new tests
Signed-off-by: Erik Hollensbe <github@hollensbe.org>
1. nats subscription draining is removed, since it is asynchronous,
and there is no reliable way to detect when it is finished.
Remove this option to avoid confusion.
2. nats connection draining is kept, and use 2 callbacks to detect
draining timeout (timeout is set via `nats.Options`) or finish.
3. Also honour options passed in `broker.Init()` (previously only
`broker.New()` is honoured).
mutex locking have errors, so when two service (one pub, other sub)
try to use this broker it waits for mutex release and nothing works
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>