Q&A

  • Is there any prerequisite to use this package?
    Yes, Swoole extension(>1.9.3) and PHP 7.1 are required to use this package.

  • Does Swoole support Windows system?
    No, currently Swoole doesn't support Windows. Ubuntu on Windows 10 can run Swoole, but it's still not recommended for production environments.

  • Can I use this package on my current Laravel projects out of the box?
    Yes and no, different from traditional PHP lifecycle, your Laravel application will only boot at the first time and persist in the memory. That means some of your original code may make app become dirty and cause unexpected bugs in this case. (see more at Swoole Structure)

This package provides basic protection for the app container though, but there are still some limitations you need to keep in mind. Please see Notices for more details.

So it depends on if your code violates these limitations.

  • How can I trace a bug that doesn't happen in traditional PHP?
    Having better understanding in multi-process programming, Swoole structure, Laravel lifecycle and Container can help you a lot to figure out what's going on with your bug.

Following Debug Guideline can also help you trace your bug more easily.

  • Does xxx package work with this package?
    We can not guarantee all the third-party packages will work well with this package; especially since some packages are not designed with the consideration of this use case.

  • Does this package support hot reload in developing?
    Yes, but the watching module is separate from this package. You can check swooletw/watcher for more details.

The watching module is implemented with node.js. Make sure you install node environment before using it.

After v2.6.0, it supports built-in hot reload with fswatch.

  • Does this package provide coroutine feature?
    There's an experimental coroutine driver for PDO in this package. However, this may cause unpredictable errors in your app in this moment. The coroutine feature is a long-term plan in the roadmap. I can't guarantee when it will be completed though.