Future Cocoa Operation

Fredrik Olsson

In Java you have for quite some time had the Future interface for encapsulating an asynchronous calculation. Cocoa has had the abstract NSOperation class to encapsulate asynchronous operations. NSOperation do not have any facilities for returning a result when done as the Future do, you are left to implement this on your own. Which I [...]

Tags: , , , , , , ,

Awaitility – Java DSL for easy testing of asynchronous systems

Johan Haleby

Introduction Testing asynchronous systems is hard. Not only does it require handling threads, timeouts and concurrency issues, but the intent of the test code can be obscured by all these details. Awaility is a DSL that allows you to express expectations of a asynchronous system in a concise and easy to read manner. Simple example [...]

Tags: , , ,

Performing any Selector on the Main Thread

Fredrik Olsson

Many UI frameworks, including AppKit for Mac OS X and UIKit for iPhone OS, require that all methods to UI components are sent on the main UI thread. Cocoa and Cocoa Touch make this quite easy by providing for example -[NSObject performSelectorOnMainThread:withObject:waitUntilDone:] in Foundation. Making updating the text for a text field a snap: [someTextField [...]

Tags: , , , , , , , , ,

Queued Background Tasks for Cocoa

Fredrik Olsson

The megahertz race is over, and instead we get more execution cores. This means that we as developers must make our applications parallel, in order to take advantage of the new performance. The easiest way to be parallel is to execute tasks in new threads, something that is useful also for lengthy but not resource [...]

Tags: , , , , , , , , , ,

Devoxx highlights

Jacob Mattsson

In order to embrace the true Christmas spirit, I thought I’d share a few goodies from the Devoxx conference that took place in Antwerp, Belgium in mid December. Devoxx is the former JavaPolis that has changed name due to trademarking issues with Sun. Nonetheless, it’s still the worlds largest independent Java conference, where the 3200 [...]

Tags: , , , , ,

Azul

Jan Kronquist

We have got the privilege to borrow an Azul Vega 1 which is the smallest of Azul‘s monster machines. This evening a bunch of us Jaywayers gathered to try it out. Installing the Azul JVM was painless and all of us were up and running very quickly. Read more…

Tags: , , ,

News On Concurrency

Jacob Mattsson

Prior to Java 5, most people associated concurrency in Java with the Thread and Runnable concepts. That has all changed now! We now have a compelling high-level API at our hands, including a lot of new concurrent data structures in the Collections Framework and a brand new task Executor framework. In this article, you’ll get [...]

Tags: ,