Catching exceptions for logging service

26 views
Skip to first unread message

Brandon Hilkert

unread,
Oct 16, 2015, 11:24:57 PM10/16/15
to Concurrent Ruby
Hey! I wrote Sucker Punch, which uses Celluloid for its Thread Pools and I've been messing around with replacing those internals with concurrent-ruby.

Two things came up during that transition:

1. Looking for an easy way to swap in a logger. I looked in to setting Concurrent.global_logger=, but it's looking for a different signature than I had previously setup. Is there an easy to to shove in something like (l = Logger.new(STDOUT); Concurrent.global_logger = l) ?

2. Sucker Punch allowed users to capture exceptions that took place in their jobs to log to an external service. This was handled with a global exception handler. This delegated to Celluloid to do the same and worked well. Does concurrent-ruby having anything like this to bubble up to Airbrake or Rollbar or something?

Great work here. The API is really user-friendly :)

Brandon

Jerry D'Antonio

unread,
Oct 17, 2015, 10:21:45 AM10/17/15
to Brandon Hilkert, Concurrent Ruby

Brandon,

Do you have a link to a working branch or a gist I could look at? I'm in vacation right now so I won't be able to look until tomorrow or Monday but I'm happy to give you feedback.

TL;DR The logger is mostly used by Actor and not much else. Logging is a side-effect and I prefer to make error handling--even logging--more explicit. All of our abstractions provide some mechanism for error handling that you can tap into. We just need to figure out what works best in your specific situation.

Sorry I can't be more detailed right now, I'm answering on my phone. :-)

Best regards,
Jerry

--
You received this message because you are subscribed to the Google Groups "Concurrent Ruby" group.
To unsubscribe from this group and stop receiving emails from it, send an email to concurrent-ru...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jerry D'Antonio

unread,
Oct 17, 2015, 10:22:56 AM10/17/15
to Brandon Hilkert, Concurrent Ruby

Sorry--I just noticed that you provided a link. I'll take a look as soon as I can!

Best regards,
Jerry

Petr Chalupa

unread,
Oct 22, 2015, 4:00:58 PM10/22/15
to Jerry D'Antonio, Brandon Hilkert, Concurrent Ruby
The logger is intended really as last resort when something really bad is happening in concurrent ruby. It's not intended for usual use. I think it might be better to wrap tasks with exception handling you would like to provide for your users.
Reply all
Reply to author
Forward
0 new messages