Giter Site home page Giter Site logo

lumen-swoole-task's Introduction

Lumen PHP Framework

Build Status Total Downloads Latest Stable Version Latest Unstable Version License

Laravel Lumen is a stunningly fast PHP micro-framework for building web applications with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Lumen attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as routing, database abstraction, queueing, and caching.

将 lumen 的 Artisan 命令和 Swoole 的 task 任务结合

通过结合 lumen 框架的 commands 来实现的 swoole task 模式

开启 Swoole 服务

进入 artisan 目录, 执行 php artisan start_swoole_serve

若是要开启常驻进程, 请执行 screen php artisan start_swoole_task_serve

用 swoole_client 向服务端发起请求

进入 artisan 目录, 指令是 swoole_client_worker, 这个指令有一个参数, 是其他的 artisan 指令, 指令之后带上一个 : 即可传入参数, 当前支持传入一个参数, 需要多个参数请自行修改。

执行 php artisan start_swoole_serve test_command:my_arg, 则这个指令将向 Swoole 服务器发出执行 test_command 的请求。

将 lumen 的 Artisan 命令和 Swoole 的 socket 任务结合

进入 artisan 目录, 执行 php artisan start_swoole_socket_server 开启swoole socket 服务器

访问 http://host/v1/chat/chatRoom 进入聊天室体验页面

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.