If I have multiple users who publish to a channel via redis how does this work? Lets say I have a php script to add a record in the db. 2 users have both subscribed to the same channel and both are entering a record into the database at once. Both use the php script to submit an entry into the db, once that is done I then use php-redis to publish to the channel. But what happens if 2 or more people do it at the same time? Does redis “lock” the first request then “unlock” the for the next request?
Share
Redis is single threaded, so one command must happen first and there is no need for locking. You generally don’t notice the blocking because most of the time taken for a single request is in network latency rather than actually processing the command.