6 ms·
ZeroRPC uses Gevent for concurrency Faults are handled differently depending on whether they are ZeroRPC-layer errors or application errors. To maintain the in
by gabrielgrant 14y ago
ZeroRPC uses Gevent for concurrency
Faults are handled differently depending on whether they are ZeroRPC-layer errors or application errors. To maintain the integrity of the connection itself, there is a heartbeat system independent of any given request. There is also an optional timeout that can be set for a given call's response. Application-level errors are propagated as "RemoteError" exceptions in the python interface. In order to collect more info about remote errors, there is also support for ZeroRPC[0] in Raven[1], the Sentry[2] client (Disqus' error logging system). In any failure case, both sides of the connection are notified and given an opportunity to clean up after themselves.
As to the philosophical concerns, I do agree on some level: RPC in general (and ZeroRPC in particular) are powerful weapons that need to be treated with care. That being said, there are a number of cases that are greatly simplified by the higher-level abstractions and more-robust error handling ZeroRPC provides.
------
[0]: http://raven.readthedocs.org/en/latest/config/zerorpc.html http://raven.readthedocs.org/en/latest/config/zerorpc.html
[1]: https://github.com/dcramer/raven https://github.com/dcramer/raven
[2]: https://github.com/dcramer/sentry https://github.com/dcramer/sentry
- sausagefeet 14y agoThanks for the response! > That being said, there are a number of cases that are greatly simplified by the higher-level abstractions and more-robust error handling ZeroRPC provides. IMO, c.call(hello, "foo", "bar') would be better than c.hello("foo", "bar"). I think the latter gives too much of an illusion of local call.
- bombela 14y agoYou can use the alternative syntax: c('hello', 'foo', 'bar') Usually, "c" will be called "logger_service" or "metrics_service", thus reminding you that you are talking to a remote service, but its obviously just a convention... Yes I know, people dont like convention, ee had cases when this illusion of a local call leaded us to do bad shit, this is true. I think its the trade-off of any abstraction. More power under your fingers-tip mean easier use for good... or bad.