-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Context.Emit -> Context.MustEmit #241
Comments
Hi @gm42, |
It is if I don't want the process to panic; this would force to wrap code with
I always thought that the
I would not know how to accomplish the same functionality of a callback with an external |
So as said, the panic in the If you do need to continue, here's a version where you could use an external Emitter.
But to be honest that's a pattern we never used. And the only scenario I can imagine where that could be used is when a processor emits messages into a different Kafka cluster that might be unavailable. |
We are going in a loop :) I am saying that "processor shutting down" does not equate to crashing a Go process with a
Prefixing it with
I understand that, however these are not bugs in the code. The package is simply designed to
Thanks for the example. So it looks like using the
Yes, when designing circuit breakers and service readiness we need to take this into account. It does not matter how often this happens, we need to cover that specific occurrence. Right now as I see it we cannot wait for a cluster to become back available so the service using |
* Co-authored-by: frairon <franz.eichhorn@lovoo.com> Co-authored-by: R053NR07 <jan.bickel@lovoo.com> * bugfix in shutdown/rebalance: correctly closing joins * run update/request/response stats in own goroutine * fix rebalancing by adding a copartitioning rebalance strategy * updated readme for configuration, added changelog * Open Storage in PartitionTable when performing Setup * return trackOutput if stats are nil * view.get fixed for uninitialized view added lots of godoc fixed many linter errors added Open call when creating storage * context stats tracking: use queueing mechanism to avoid race conditions * Add simpleBackoff and add backoff options for processor and view * added strings to streams helper * #249 view example * issue #249: migration guide, #241 panic documentation of context * #248 exposing partition table's connection state to view * Migration: describe offsetbug * partition_table: implement autoreconnect in recovery mode * bugfix goroutine-leak in statsloop in partition table * #248: refactored state merger, bugfix race condition when shutting down the signal/observers, created example * bugfix partition state notification * remove change in example, updated changelog * fix readme example and add readme as example * restore 1-simplest fix, remove readme-example Co-authored-by: Jan Bickel <jan.bickel@lovoo.com>
That is much better now, thanks! |
I just noticed that
Context.Emit(...)
callsContext.Fail(err error)
which in turn panics.I would mention in the GoDoc of
Fail
that a panic will happen and I would have calledEmit
asMustEmit
to follow Go's practice to prefix panicking methods withMust
.What are your thoughts about this? Perhaps you could include some improvements in next major version.
The text was updated successfully, but these errors were encountered: