Leipzig Gophers
blog

🔗Virtual Meetup #15 wrap-up

Concurrent woes

We had two input presentations, both involving concurrent constructs.

First, we heard from the author of package waitgroup about problems with concurrent code, waitgroups and shutdowns (especially in cloud native and serverless scenarios). The basic problem: At shutdown time, you want to be graceful, but at the same time enforce a hard timeout on a number of processes running (and potentially joining in a wg.Wait).

Enter package waitgroup which allows to preempt running goroutines. The general problem of goroutine termination is hard, and even harder, if you have a large code base and a tree of concurrent routines in flight, that need some kind of cancellation (modern packages use context, or maybe manual timeouts).

The solution of waitgroup is to embed the standard library waitgroup and combine it with a timeout. The package comes with examples too:

Testing concurrent code is its own challange, but this package has examples for that as well.


The second lightning talk summarized chapter 2 on “Filters” from Software Tools by Kernighan and Plauger (1976) and highlighted some timeless ideas on software style (today, you might say clean code). Go has great facilities for streaming data processing in the io package. Furthermore, you can spice up filters with parallel processing, without adding much complexity to the program.

That’s what parallel is about - it allow to write parallel filters fast. The package is best used as a little utility for one off filters.

Misc

The best about meetups are things beyond slides and code: discussions, screen shared setups, neat tools people use, and much more.

Here’s a list of things to check out:

Can you tame complexity with BDD style development? A VMware Office of the CTO tech deep dive addresses this question in a blog post:

As for stream processing, there is a classic blog post, as well as a few interesting projects:

Fast things:

Basic (database) things:


Join our meetup to get notified of upcoming events!