Best practices for long running servers

327 views
Skip to first unread message

Eran Sandler

unread,
Apr 1, 2014, 5:34:15 AM4/1/14
to golan...@googlegroups.com
Hi all,

I've been working for a while on a Go implementation of Twitter's Snowflake unique ID generation service.

You can check it out here: https://github.com/erans/gosnowflake

I would love to get feedback in general and on the code and styling as this is my first "real" Go based project.

I was wondering what is the correct way to implement a server in terms of error handling. Do the "Serve" command needs to handle everything and panic if things go really wrong (memory issues, etc).

I've recently added Thrift support to it and when I forgot to correctly implement one method the server blew up. Is there a way to catch it in a more graceful way?

Thanks,
Eran

wkharold

unread,
Apr 1, 2014, 11:09:19 AM4/1/14
to golan...@googlegroups.com
A similar effort from a couple of years ago: https://github.com/bmizerany/noeqd

Eran Sandler

unread,
Apr 1, 2014, 1:29:52 PM4/1/14
to wkharold, golan...@googlegroups.com
Thanks. I will take a look.

No one touched it for 2 years and it doesn't have Thrift support, but I'm sure I can learn a couple of things from that.

Eran


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

Reply all
Reply to author
Forward
0 new messages