Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 335 Vote(s) - 3.52 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scala: Redis client implementation with Akka futures

#1
I'm looking for Redis client implementation for Scala. The client should be async and non-blocking, using Akka futures.
What I found more or less useful:

1.

[To see links please register here]

2.

[To see links please register here]


But both of them have their issues. First one uses old version of Akka, which causes compilation issues, second one uses scala.actors.Futures.future instead of Akka futures.
I saw a conversation, which took place few months ago: groups.google.com/forum/#!msg/akka-user/EDKA2aTigho/_wWcNIz2O3wJ

But I failed to find any solution.
Anyone had something similar?

Thanks for your answers.
Reply

#2
[scala-redis][1] is currently the best option. While it is a blocking client, some examples of asynchronous patterns are [given in the README file][2]. Also note that the library itself does not use `scala.actors.Futures.future`; only demo code in the spec (test code) and README does.

If you only need to store a few things in Redis, it's also possible to [roll your own Redis client with a Spray.io `IOBridge`][5].

On a sidenote: [Akka futures are already in Scala 2.10.0][3] and `scala.actors` [is deprecated as of Scala 2.11.0][4]. I'm not sure why scala-redis is using `scala.actors` even though it depends on Akka and Scala 2.10.0.

[1]:

[To see links please register here]

[2]:

[To see links please register here]

[3]:

[To see links please register here]

[4]:

[To see links please register here]

[5]:

[To see links please register here]

Reply

#3
There's a non-blocking client that returns Futures available as the finagle-redis module.
Example usage here:

[To see links please register here]


A caveat: it currently returns Twitter Futures. You can use that to complete the Promise for an Akka Future; an example of that is on the first code example in the slides for Blake's NEScala talk:

[To see links please register here]


People at Twitter say they'll have Twitter futures implement the 2.10 Future trait for API compatibility, when they move to 2.10.

The author of scala-redis sounded interested in porting it to use spray-io, in which case it would be non-blocking.
Reply

#4
There is also [scredis](

[To see links please register here]

) which is a complete, non-blocking and blazing fast Scala Redis client built on top of Akka IO. It is extensively used in production at Livestream.
Reply

#5
Here are a few new Scala Redis libraries that are Reactive (async + non-blocking):

[To see links please register here]

[To see links please register here]

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through