Can PHP's array_push and array_pop be used instead of redis' list?
巴扎黑
巴扎黑 2017-05-16 13:14:47
0
4
1124

When making queues, for example, when queuing for product orders, we use redis' list. I think we can use PHP's array_push and array_pop instead of redis' list?

巴扎黑
巴扎黑

reply all(4)
过去多啦不再A梦

An array cannot exist between multiple requests. When a single request ends, the process ends, resources are released, and the array is destroyed. Data persistence is required

漂亮男人

Obviously not. If you can play like this, there will be no need to cache anything

我想大声告诉你

php is a process, it will not exist the next time after one request. Unless you store this array in the database

漂亮男人

Yes, but you need to use cache to save the status of pushing and popping the stack, because the data of a single user process will not be shared with other users. You need to save it every time it changes. If you don’t need to save it with redis, then use file cache every time. All changes must be saved

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template