New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem in running Redis #9
Comments
Just to make sure, you are already running a server on localhost? |
Thanks for the reply. My problem is solved. I didn't run redis server.
My last comment is that the link for the akka snapshot ( Regards, On Thu, Sep 8, 2011 at 12:24 PM, Derek Williams <
|
I made quite a bit of changes in the last couple months, and I haven't been doing a great job of keeping the documentation up to date. Having said that, your best bet is to use the 'akka-1.2' branch since it will use the latest RC release of Akka 1.2 (and the final 1.2 when it is released). I also publish snapshots (and later, releases) at http://repo.fyrie.net/ which can be used as dependencies in your own projects. I hope that helps, and thanks for the feedback! I'm closing this issue, but feel free to send me any other questions you might have. |
Hi Derek, Thanks for the responses.
Since all the clients in the same machine use the same socket, if there are
The latest version didn't work. I used the snapshot 2.0-20110817-000155 and Thanks again. I'll be in touch with you. Regards, |
|
Then you should keep track of requests that have been sent. If multiple |
2 actors are used per client. One is for sending requests, the other is for receiving responses. Each one processes it's messages sequentially (well, mostly. the receiver 'suspends' the message it is working on if it needs to wait for more data to be read). As of right now all responses are returned using futures, which is how the response ends up in the right place. The only exception to this is PubSub, which is implemented by sending responses with actors. A PubSub subscriber is created with the 'RedisClient.subscriber(listener: ActorRef): ActorRef' method, which takes a user created ActorRef (like the one created in the PubSub test) and returns a client that only handles PubSub messages for that actor. If multiple listener actors are required, they each get a separate subscriber redis client. Usually only a single listener is actually required since mutiple channels can be subscribed to by a single client. From there it can send the received messages to the appropriate actor for actual processing. |
And each client has a separate socket. So, they cannot share the same socket Regards, |
The IO stuff is all meant to be a simple NIO abstraction for use in Akka. It will be included in Akka 2.0, but I've included it with the fyrie-redis code for versions 1.2 and 1.1 since it works without issues. The IO actor trait provides a simple api for an actor to read data in chunks. It uses Scala's delimited continuations plugin to turn imperative looking code into CPS style code. For example (taken from RedisClientWorker): def readBulk = {
val length = socket read EOL
matchC(length.utf8String.toInt) {
case -1 ⇒ RedisBulk.notfound
case 0 ⇒ RedisBulk.empty
case n ⇒
val bytes = socket read n
socket read EOL
RedisBulk(Some(bytes))
}
}
The IO actor trait is not needed and this could all be done manually of course. Only the The IOManager is the actor that creates and sends messages to the NIO selector thread that does the actual IO. Only 1 IOManager is required for an application, depending on if the selector can handle the load on it or not. I haven't delved too deeply into those types of issues yet and there doesn't seem to be much info out there about those issues other then it being dependent on the underlying operating system. |
Hi,
I am trying to run Redis. But when I use "val r = new RedisClient("localhost", 6379)" I am always getting the message"Connection refused" and "timeout". I followed all the instruction you mentioned in the web page. How can I solve the problem?
Thanks,
Samira
The text was updated successfully, but these errors were encountered: