Adventures in Perl 6 Asynchrony - Jonathan Worthington (‎jnthn‎)
Channel: yapceu
Date: 24/10/2014

Events in a user interface. Incoming web requests in a web server, or responses for a web client. File change notifications. Work kicked off to a background thread getting done. Messages arriving from a message queue. What do they all have in common? They've sources of asynchronous data!

Our programming languages have traditionally been good at providing abstractions for synchronous programming. Indeed, subroutines and methods are centered around the notion of making a call and blocking until there's a result. And when there's many values, iterators are a common way of working our way through lines of a file, rows from a database, or pretty much anything else - but again, the caller always blocks until the next value is available.

In Perl 6, we're providing abstractions for asynchronous programming also: the Promise for single results produced asynchronously, and the Supply for streams of results produced asynchronously. These streams can be grepped, mapped, and zipped just like their synchronous cousins - except you're writing a map over data that will arrive in the future!

Join me for a deep dive into asynchronous programming in Perl 6, packed with examples and live demos!

http://act.yapc.eu/ye2014/talk/5635