定制 ensi/octane-swoole-urgent-starter 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ensi/octane-swoole-urgent-starter

Composer 安装命令:

composer require ensi/octane-swoole-urgent-starter

包简介

Laravel octane swoole urgent starter

README 文档

README

Latest Version on Packagist Tests Total Downloads

This package adds alternative behaviour to octane server for dev and prod usage.
Dev: server process continue work even if syntax error appears in code.
Prod: you can start swoole master process directly, without artisan command, which consumes some memory.

Installation

You can install the package via composer:

composer require ensi/octane-swoole-urgent-starter

and add this section to config/octane.php file

'swoole' => [
    'command' => '/var/www/vendor/bin/urgent-swoole-server',
    'show_fatal_error' => env('OCTANE_SHOW_FATAL_ERROR', false),
]

Version Compatibility

Laravel Octane swoole server starter Laravel Octane PHP
^0.1.0 ^1.2 *
^2.0.0 ^2.0 ^8.1

Basic Usage

Dev

Just start octane server with swoole backend and --watch option, and see how it reloads after very fatal errors.
If you want to see error message in http response, set true to OCTANE_SHOW_FATAL_ERROR environment variable.

Prod

Originally, octane:start command makes server state file and then starts swoole process as child.
Now you can to separate this to two steps.
First: use octane:dump-server-state command for saving server state file.
Second: start swoole process, without any useless parent.

php artisan octane:dump-server-state --host=0.0.0.0 --port=8000 --workers=20

export APP_ENV=production
export APP_BASE_PATH=/var/www
export LARAVEL_OCTANE=1

php ./vendor/bin/swoole-server /var/www/storage/logs/octane-server-state.json

When service works in ELC workspace

Old elc workspace template uses hack for reloading code without container restarts. You should to replace last artisan command in templates/swoole-X.X/php/entrypoint to this

OCTANE_SHOW_FATAL_ERROR=true php artisan octane:swoole --watch --host=0.0.0.0 --workers=1 --task-workers=1 || sleep 3600

Contributing

Please see CONTRIBUTING for details.

Testing

  1. composer install
  2. composer test

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

License

The MIT License (MIT). Please see License File for more information.

ensi/octane-swoole-urgent-starter 适用场景与选型建议

ensi/octane-swoole-urgent-starter 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 56.95k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2022 年 11 月 09 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 ensi/octane-swoole-urgent-starter 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ensi/octane-swoole-urgent-starter 我们能提供哪些服务?
定制开发 / 二次开发

基于 ensi/octane-swoole-urgent-starter 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 56.95k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 18
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-11-09