implicit.ly

Scala software, hot off the presses

Dispatch 0.7.5

Databinder Dispatch is a library for HTTP interaction, from asynchronous GETs to multi-part OAuth-enticated POSTs.

Filed under  //   Dispatch   Scala 2.7.5   Scala 2.7.6   Scala 2.7.7   Scala 2.8.0   configgy   net.databinder  

Dispatch 0.8.0.Beta1

Welcome to the Dispatch 0.8.0 track! This line depends on HttpComponents 4.1, currently in alpha2. To keep things simple we're just doing beta incrementals until they release a final.

Unless you need an 0.8 feature now, you can save yourself some trouble by staying with the 0.7 line, where all bug fixes as well as all new features that don't require HttpComponents 4.1 will land until the final release of 0.8.0.

  • New http-gae module for Google App Engine support, contributed by maxaf
  • Configurable max pooled connections in dispatch.Threads

Databinder Dispatch is a library for HTTP interaction, from asynchronous GETs to multi-part OAuth-enticated POSTs.

Dispatch 0.7.4

  • Deprecate Http#also since Http#x with Handler#apply can do the same thing, but better.
  • Deprecate <<< (a: Any) in favor of <<< (s: String)
  • Improve error message for missing entity error
  • Encode asterisks according to the OAuth spec
  • Depend on lift-json M5
  • Cross-publish for Scala 2.8.0.RC3

Databinder Dispatch is a library for HTTP interaction, from asynchronous GETs to multi-part OAuth-enticated POSTs.

Dispatch 0.7.3

Databinder Dispatch is a library for HTTP interaction, from asynchronous GETs to multi-part OAuth-enticated POSTs.

Dispatch 0.7.2

Databinder Dispatch is a library for HTTP interaction, from asynchronous GETs to multi-part OAuth-enticated POSTs.

Dispatch 0.7.1

  • No code changes from last release; republishing with sbt 0.7.1 for a corrected pom.xml structure.

Databinder Dispatch is a library for HTTP interaction, from asynchronous GETs to multi-part OAuth-enticated POSTs.

Dispatch 0.7.0

The big news is built-in support for asynchronous HTTP interaction. Although asynchronous execution can be implemented fairly directly in Scala, the new interface guarantees that a thread-safe instance of HttpClient is in use and simplifies exception handling.

The foundation of this support is in a new module dispatch-futures, which has no dependencies and may be used from other libraries. It defines a structural type dispatch.futures.Futures.Future that corresponds with scala.actors.Future, though its current default implementation is a java.util.concurrent.Future. The dispatch-http module now depends on dispatch-futures and includes a dispatch.Threads mix-in for the base dispatch.Http class that enables asynchronous interaction. It can be used as follows:

import dispatch._
val http = new Http with Threads
val fut_str = http.future(:/("example.com") as_str)
// returns immediately. If we later need that string...
fut_str() // blocks until it is available

If you won't ever access the results from the main thread, you may want to process any exception it throws:

http on_error {
  case e => println(e.getMessage)
} future (:/("example.com") >- { str =>
  // do something with this string as soon as it's available
})

If you want to describe future-interaction with a fully defined request Handler like the one returned by dispatch.meetup.Auth.access_token(), you can extend it with the new ~> operator defined on Handler:

http.future(Auth.access_token(consumer, request_token, verifier) ~> { access_token =>
  // I'm in the vault!
})// <- returns immediately

And by request, the << operator on Request is now overloaded to support plain string POSTs.

Databinder Dispatch is a library for HTTP interaction, from asynchronous GETs to multi-part OAuth-enticated POSTs.