Contrast to Python's gevent

Skip to first unread message

Martin Konecny

Feb 1, 2015, 9:35:02 PM2/1/15
I've been doing some research on Goliath, and seems like something I will want to migrate over to soon. My question is, one of the promises of Goliath is that it "preserves the look and feel of a synchronous API!". 

However from the examples, I see that I still need to use em-synchrony, em-http etc. One of the reasons I'm looking into moving away from thin, is because of the poor official evented library support for some databases (i.e mongo)

When working with gevent in Python, the gevent library will monkey-patch all socket calls and automatically cause the current fiber/greenlet to yield to another fiber/greenlet anytime a blocking network operation initiates. This causes it to work with almost every database driver without any work required from said driver's authors. Am I correct that goliath does not work like this?

Is it correct that Goliath still needs em-* libraries/drivers for any blocking network operations, but it's advantage over thin is that you don't need to write callbacks for these, instead it is code that can be linearly written?


Eric Marden

Feb 2, 2015, 11:43:03 AM2/2/15
You can use Goliath with blocking i/o libs — but it does defeat some of the performance gain (over say something like Sinatra). You’ll still be able to take advantage of the asynchronous middleware layer which has it’s own benefits even when your db calls block the reactor. I’ve used both Mongoid (v2) and em-mongo ( with Goliath and while it was a bit more work to use em-mongo, the results were better enough, in terms of throughput, to put up with the extra effort. YMMV, of course.

Eric Marden
PGP Public Key:
> --
> You received this message because you are subscribed to the Google Groups " (" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to (
> For more options, visit

Reply all
Reply to author
0 new messages