All Projects → hyperf → gotask

hyperf / gotask

Licence: MIT license
⚡️ A lightning speed replacement for Swoole TaskWorker in Go

Programming Languages

PHP
23972 projects - #3 most used programming language
go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to gotask

MineAdmin
🎉🌈🔥MineAdmin是基于Hyperf框架 和 Vue3+Vite3 开发的前后端分离权限管理系统,自适应多终端。特色:crud生成 + json配置化开发一把梭
Stars: ✭ 142 (-13.41%)
Mutual labels:  swoole, hyperf
hyperf-v2-demo
Hyperf Demo(easywechat,chat)
Stars: ✭ 19 (-88.41%)
Mutual labels:  swoole, hyperf
thrift2-hbase
thrift2-hbase component for Hyperf.
Stars: ✭ 14 (-91.46%)
Mutual labels:  swoole, hyperf
HyperVue
🚀 基于 Hyperf + Vue + ElementUI 前后端分离的通用型管理后台
Stars: ✭ 23 (-85.98%)
Mutual labels:  swoole, hyperf
Hyperf
🚀 A coroutine framework that focuses on hyperspeed and flexibility. Building microservice or middleware with ease.
Stars: ✭ 4,206 (+2464.63%)
Mutual labels:  swoole, hyperf
TT Jobs
基于 Swoole 定时管理系统
Stars: ✭ 22 (-86.59%)
Mutual labels:  swoole
http-emitter
📡 Emitting psr-7 responses.
Stars: ✭ 31 (-81.1%)
Mutual labels:  swoole
yii2-s
🚀speed up yii2 tcp server、 restful by swoole
Stars: ✭ 34 (-79.27%)
Mutual labels:  swoole
swoole-link-monitor
基于swoole 定时器与woker 实现链路监控
Stars: ✭ 34 (-79.27%)
Mutual labels:  swoole
awesome-swoole
💎 A curated list of awesome things related to Swoole.
Stars: ✭ 129 (-21.34%)
Mutual labels:  swoole
wlsh-framework
名词解释:wlsh( 为了生活---每个字的第一个拼音 )酷毙的码农为了生活自由,基于composer整合yaf框架与swoole等扩展,开发的php协程组件;低耦合,使用非常少的语法糖,尽量使用原有扩展中的语法。
Stars: ✭ 18 (-89.02%)
Mutual labels:  swoole
php-tdengine
大数据引擎 TDengine 的 PHP 客户端扩展,支持 Swoole!
Stars: ✭ 62 (-62.2%)
Mutual labels:  swoole
http
Support Swoole Implement PSR7
Stars: ✭ 28 (-82.93%)
Mutual labels:  swoole
static-php-cli
Build single static PHP binary in linux, build with PHP project together, with Swoole and other popular extensions included.
Stars: ✭ 129 (-21.34%)
Mutual labels:  swoole
swoole-cs.github.io
swoole 4.x cheat sheet
Stars: ✭ 21 (-87.2%)
Mutual labels:  swoole
fast-laravel
基于Swoole的高性能HTTP服务器,加速您Laravel应用程序。
Stars: ✭ 33 (-79.88%)
Mutual labels:  swoole
docs
Lawoole documentation
Stars: ✭ 12 (-92.68%)
Mutual labels:  swoole
hyperf-http-auth
hyperf框架http登录授权组件
Stars: ✭ 16 (-90.24%)
Mutual labels:  hyperf
swoole api framework
swoole
Stars: ✭ 28 (-82.93%)
Mutual labels:  swoole
orange
基于beanstalkd实现多进程处理消息队列的框架
Stars: ✭ 19 (-88.41%)
Mutual labels:  swoole

GoTask

English | 中文

Build Status

GoTask spawns a go process as a Swoole sidecar and establishes a bi-directional IPC to offload heavy-duties to Go. Think of it as a Swoole Taskworker in Go.

composer require hyperf/gotask

Feature

  • High performance with low footprint.
  • Based on Swoole 4 coroutine socket API.
  • Support Unix Socket, TCP and stdin/stdout pipes.
  • Support both PHP-to-Go and Go-to-PHP calls.
  • Automatic sidecar lifecycle management.
  • Correctly handle remote error.
  • Support both structural payload and binary payload.
  • Sidecar API compatible with net/rpc.
  • Baked-in connection pool.
  • Optionally integrated with Hyperf framework.

Perfect For

  • Blocking operations in Swoole, such as MongoDB queries.
  • CPU Intensive operations, such as encoding and decoding.
  • Leveraging Go eco-system, such as Kubernetes clients.

Requirement

  • PHP 7.2+
  • Go 1.13+
  • Swoole 4.4LTS+
  • Hyperf 1.1+ (optional)

Task Delivery Demo

package main

import (
    "github.com/hyperf/gotask/v2/pkg/gotask"
)

type App struct{}

func (a *App) Hi(name string, r *interface{}) error {
    *r = map[string]string{
        "hello": name,
    }
    return nil
}

func main() {
    gotask.SetAddress("127.0.0.1:6001")
    gotask.Register(new(App))
    gotask.Run()
}
<?php

use Hyperf\GoTask\IPC\SocketIPCSender;
use function Swoole\Coroutine\run;

require_once "../vendor/autoload.php";

run(function(){
    $task = new SocketIPCSender('127.0.0.1:6001');
    var_dump($task->call("App.Hi", "Hyperf"));
    // [ "hello" => "Hyperf" ]
});

Resources

English documentation is not yet complete! Please see examples first.

Benchmark

https://github.com/reasno/gotask-benchmark

Credit

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].