Posts Tagged: multi-threading

network pc monitors

Parallel RxJava and Spock Oddity

Posted by & filed under , .

I use RxJava a lot nowadays — back in the day before I joined Netflix I was struggling with it a bit and mostly watched from the sideline but nowadays I find myself pulling in that dependency in a lot of the Java code I’m writing. And I also use the Spock framework a lot […]

network pc monitors

Interesting Java Jersey + RxJava finding

Posted by & filed under , .

It so happens that in a few of the apps I work on here in Netflix we use Jersey libraries inside a Tomcat container. As such I use the JSR annotations a lot safe in the knowledge that Jersey will take care of all the plumbing work and deal with routing and serialization/deserialization so I […]

RxJava: Some Usage of Observable.zip

Posted by & filed under , .

Here’s  classic problem when dealing with a web app: you get a HTTP request to your app with a set of parameters. You need to hit a datastore to retrieve some record based on those parameters. You also need to create a (log?) entry somewhere about receiving this call — whether it’s for monitoring purposes […]

Please Stop Using Thread.sleep() in Java!

Posted by & filed under , , .

Ok, I need a good moan about this to the extent that it deserves its own blog post, but I had it with the bloody Thread.sleep() method in Java! I know it was the only way to “sleep” back in the day but seriously, but seriously, we have TimeUnit since JDK 1.5 — and nowadays […]

JAX London Logo

Of Java Streams … Again!

Posted by & filed under .

I just went again through this JAX London write-up (read more here: http://www.infoq.com/news/2015/10/jax-london-2015-round-up) and thought it was worth some more thoughts from me. As you might recall, I have touched before on the subject of Java 8 streams in this blog post back in Sep/2014. The thing that puzzled me back then was the fact […]

Small Yet So Costly Java Mistake

Posted by & filed under , , .

OK so I felt like I needed to share this code with “the world” as I think it’s a good example of a few things: first of all nobody’s perfect — I know you read that in my website tag line 🙂 but yeah nobody’s perfect… sadly, in this instance, myself included 🙂 secondly, it […]

Apache Cassandra

Small (Yet Interesting!) Cassandra Test

Posted by & filed under , , .

I have worked recently in Netflix on a project which was hitting one of our Cassandra clusters. (By the way, we use Cassandra here a lot, wherever possible we prefer it to RDBMS, so we got tons of instances running Cassandra.) Part of what my code had to do was to retrieve a set of […]

Do We Still Need the Singleton Pattern?

Posted by & filed under , , .

If you have been working in software engineering for a while chances are you have often come across (even if you didn’t know it!) design patterns. If you haven’t, as I said, chances are you just don’t realise you have used them — so I strongly suggest the “Gang of Four” book as a starting […]

Java 8 Accumulators and Adders

Posted by & filed under , , , .

If you’ve been using Java for a while now, then like me, you must have saluted the move quite a while back in JDK 1.5 to introduce the atomic classes (AtomicLong, AtomicBoolean and so on). They were a big step forward, away from the clunkyness of having to create ridiculous bottlenecks in the code for […]

Play Framework

About the Play! Framework and Their Thread Pooling

Posted by & filed under , , .

This is a rather interesting find and I’m still looking into it — so hopefully will come back with more insights on it — but I thought I’d publish these things as I find them. So bear with me as I unravel this mistery — as of right now, unless I’m looking in the wrong […]