We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
情景: 我的程序里面有一个服务需要加载字典,字典内容多需要加载的时间长。因此我想把服务像laravel的app一样被laravels从入口处加载,这样就可以一次加载,后面所有请求都直接调用,免去每个请求都把它实例化一次,把字典重新读取一次这么浪费时间。
问题: 那么我应该怎么把这个加载字典的工具,跟laravel的框架一起实例化加载到swoole中运行呢?
The text was updated successfully, but these errors were encountered:
编写一个类来存储你对应的字典,然后通过ServiceProvider注册单例到Laravel,这样每个worker公用此单例。
Sorry, something went wrong.
我查了一下,swoole是不会主动释放global和static的数据。所以我直接用global存储一次,后面就到处都可以调用了
可以,你知道这些是常驻的就行。
No branches or pull requests
情景:
我的程序里面有一个服务需要加载字典,字典内容多需要加载的时间长。因此我想把服务像laravel的app一样被laravels从入口处加载,这样就可以一次加载,后面所有请求都直接调用,免去每个请求都把它实例化一次,把字典重新读取一次这么浪费时间。
问题:
那么我应该怎么把这个加载字典的工具,跟laravel的框架一起实例化加载到swoole中运行呢?
The text was updated successfully, but these errors were encountered: