spray / spray-can

A low-overhead, high-performance, fully async HTTP 1.1 server and client library implemented entirely in Scala on top of Akka
http://spray.io
Apache License 2.0
153 stars 19 forks source link

Akka 2.0 Support #14

Closed onsails closed 12 years ago

onsails commented 12 years ago

Hello and happy new year! Our company is developing project depends on Akka 2.0. Now we need async http client as part of the project. We love spray-can and began work on porting it to Akka 2.0 (M2). Do you already have any ideas about spray-can and Akka 2.0? Have you any suggestions for us?

sirthias commented 12 years ago

Great! Of course the migration to Akka 2.0 is on our list and we'll start working on it as soon as Akka 1.3 final is out. However, this migration will come with a significant refactoring since the current spray-can architecture is not clean enough to form a proper base for the various plans we have with moving spray-can forward. We have not yet had the time to look into what the main obstacles for a Akka 2.0 migration are... maybe you could fill us in in this respect?

onsails commented 12 years ago

The first obstacle we discovered is that Akka 2.0 does not provide simple method of creating own dispatchers (some types are strongly private, figured out by declaring SelectorWakingDispatcher in akka package. not shure it is good way). The second one is that you can't use custom attributes in dispatcher's constructor. To start actor with your dispatcher you should declare its configuration in akka.conf and write something like this: system.actorOf(Props[MyActor], name = "myactor").withDispatcher("my-dispatcher") This means that spray-can needs significant refactoring of nio selector waking up system.

onsails commented 12 years ago

I decided to remove SelectorWakingDispatcher and use akka.actor.io for IO management

onsails commented 12 years ago

So. Akka 1.3 released and if you going to start upgrading spray-can to akka-2.0 you can get commits from my fork. Most specs in spray-can subproject are passing (except timeout logic yet).

There is something you should know. I removed SelectorWakingDispatcher and got selector logic from Akka's IO.scala) and using selectNow. Perhaps it is not good way here but I couldn't find enough time to implement SelectorWakingDispatcher's logic in akka 2.0 context.

sirthias commented 12 years ago

Thanks! I'll be sure to take a look at your code.

I'm in the middle of refactoring spray-can for Akka 2.0 myself (and it's a BIG refactoring). The internal architecture will be completely overhauled and cleaned up, and so is going to be the API.

However, I'll release version 0.9.2 before making these big changes public...

Cheers, Mathias


mathias@spray.cc http://www.spray.cc

On 01.02.2012, at 15:07, wishbear wrote:

So. Akka 1.3 released and if you wish to start upgrading spray-can to akka-2.0 you can get my commits from my fork. Most specs in spray-can subproject are passing (except timeout logic yet).

There is something you should know. I removed SelectorWakingDispatcher and got selector logic from Akka's IO.scala) and using selectNow. Perhaps it is not good way here but I couldn't find enough time to implement SelectorWakingDispatcher's logic in akka 2.0 context.


Reply to this email directly or view it on GitHub: https://github.com/spray/spray-can/issues/14#issuecomment-3759242

sirthias commented 12 years ago

Available with the current spray-can 1.0 (milestone) in the spray repository.