Pages with session_start() don't load when server-sent event is running

后端 未结 1 844
不知归路
不知归路 2021-01-21 17:24

I\'m working on a little project to make a 1v1 chat system. I wanted to work on a project where I could put Server-Sent Events to good use. It\'s been working prett

相关标签:
1条回答
  • 2021-01-21 17:43

    PHP has exclusive lock around session. Only one process at a time can use it. This is usually unnoticeable because PHP processes start and end quickly, but with SSE you're keeping the session open forever and all other PHP processes will wait until SSE process ends.

    You can execute session_write_close() to release the session to other processes.

    0 讨论(0)
提交回复
热议问题