Comments (3)
Thanks for the note. This is a worthwhile idea, but it could get tricky quickly, because I think you'd want to count how many retries had been performed for a particular batch so that you don't retry an arbitrary number of times if the network goes down (and putting them back on the queue would then potentially overflow the queue, preventing new messages from being sent). Then you have to worry about how many retries, backoff, etc.
I'd probably lean towards having your monitoring system monitor the error/exception logs in send_socket
and alerting you on failure so you can fix the underlying issue.
However, if you did want to do this, I'd suggest subclassing Sender
and overriding send_socket
in your own code. You could either just retry a couple of times in a loop if there's an exception, or push the message back onto the queue to be picked up in the next interval.
from graphyte.
Also library is swallowing almost all exceptions, so even in synchronous mode you cannot retry
from graphyte.
@krzysbaranski I presume you're referring to the except Exception
in send_socket
? True, though that's definitely by design. The thinking is the caller shouldn't have to worry about errors; so graphyte
logs them (assuming you're doing something with your logs).
If you want to do retries or more complex behavior, you can subclass Sender
and override send_socket
(which is used in both sync or async mode), adding your own exception handling, retries, etc. In your override, you'd call send_message
-- which doesn't have a catch-all except
clause -- to do the low-level sending operation.
I'm going to close this issue per my earlier message.
from graphyte.
Related Issues (11)
- Add support for sending data in pickle format HOT 2
- Exceptions should be thrown for the upper level to handle. HOT 1
- Batch and interval arguments are confusing HOT 2
- add support for a statsd styled message HOT 3
- Propagate Connection Exceptions HOT 5
- distutils is deprecated in Python 3.10 HOT 2
- installing in windows causing error HOT 2
- rounding timestamp will loose some data HOT 1
- Data not getting added when given past datetime, but works for datetime of today. HOT 2
- Sending large number of messages via async method causes loss of data HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphyte.