Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Porting python-twisted based code to scala: framework advice needed

I am trying to port a significant amount of code written in python with twisted to scala, and I'm looking for opinions on what framework combination to choose.

The thing is essentially an RPC (custom protobuf-based + xmlrpc)/HTTP server and client, that does some database-keeping and transformations but later sends down rpcs to workers which are outside of the scope of this rewrite.

As a network IO/base for implementing RPC stack I am using netty. All the workflows in the old thingy were based on twisted's Deferred, and to replace it I'm currently considering either ChannelFuture directly, or wrapping it inside either scalaz.Promise or akka.Future.

I guess, one part of the question is - can it be done simpler than manually working with callbacks? I guess, if I choose this route, I can simplify it later by adding some wrappers and using continuations, but maybe I need to use something different from the beginning?

I tried to fit the workflow inside actor model but it doesn't seem to work with stdlib actors.

Thanks.

Update: Finagle seems to be modeled closely after, or at least accidentally similar, to twisted. twitter.util.Future looks a lot like twisted's Deferred. So I'm using it for the moment.

Update 2: The reasons why I ported it in the first place are static typing and performance.

like image 874
Stingray Avatar asked May 15 '11 11:05

Stingray


1 Answers

Finagle seems to be modeled closely after, or at least accidentally similar, to twisted. twitter.util.Future looks a lot like twisted's Deferred. So I'm using it for the moment.

like image 95
Stingray Avatar answered Sep 28 '22 07:09

Stingray