recentpopularlog in

ianweatherhogg : non   32

The Neophyte's Guide to Scala Part 9: Promises and Futures in practice - Daniel Westheide
Sometimes, there is no NIO-based library available. For instance, most database drivers you’ll find in the Java world nowadays are using blocking IO. If you made a query to your database with such a driver in order to respond to a HTTP request, that call would be made on a web server thread. To avoid that, place all the code talking to the database inside a future block, like so

import concurrent.future
future {
queryDB(query)
}
scala  concurrency  idiom  promise  non  io  executor  context  5*  block 
april 2013 by ianweatherhogg
M2HTTPD: A pipelined, non-blocking, extensible web server in under 1400 lines of Scala
Using coroutines, the punchline in the web server becomes a single line: listen ==> connect ==> process ==> reply
mattmight  scala  web  non  server  coroutine  continuation  5*  block 
november 2012 by ianweatherhogg
Task Dispatch and Nonblocking IO in Scala : Havoc's Blog
Dispatch just means scheduling the task on a thread and executing it.
io  scala  node  javascript  non  dispatch  akka  actor  rabbitmq  5*  future  stream  processing  async  mongo  db  block 
november 2011 by ianweatherhogg

Copy this bookmark:





to read