Closed z64 closed 7 years ago
Upon reading closed issues, it would seem the following hadn't made it's way into the docs, as the example provided in https://github.com/stefanwille/crystal-redis/issues/8#issuecomment-158613225 seems to have fixed my use case.
The code shares one socket across multiple threads, and that can't work. Each thread must have it's own tcp connection to Redis.
As shown in the snippet, instancing a new connection in the event thread appears to work.
Hi Zac, this is documented here: https://github.com/stefanwille/crystal-redis/blob/master/src/redis.cr#L31-L34
Apologies - Not sure how I missed that!
Thank you.
No problem :)
I have renamed the issue in case somebody else with the same problem searches the issue list.
Hi! I'm looking to understand why this is occurring in the following code, and how to handle it.
I have the issue of generating an ID with
INCR
and immediately using it toSET
. My app receives packets from a websocket connection and I'm caching them for potentially multiple clients to replay, so I'm just using this to ensure a sortable ID that clients can request.Produces:
Is there something else I should be using to facilitate this pattern, or is there something else afoot?