Code Monkey home page Code Monkey logo

webman-push-server's Introduction

workbunny

webman-push-server's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

webman-push-server's Issues

Call to undefined method Redis::xAutoClaim()

新创建的webman项目,引入webman-push-server,出现错误,composer update 也无效
php 版本8.1

❯ php --ri redis

redis

Redis Support => enabled
Redis Version => 5.3.7
Redis Sentinel Version => 0.1
Available serializers => php, json

composer.json

{
  "name": "workerman/webman",
  "type": "project",
  "keywords": [
    "high performance",
    "http service"
  ],
  "homepage": "https://www.workerman.net",
  "license": "MIT",
  "description": "High performance HTTP Service Framework.",
  "authors": [
    {
      "name": "walkor",
      "email": "[email protected]",
      "homepage": "https://www.workerman.net",
      "role": "Developer"
    }
  ],
  "support": {
    "email": "[email protected]",
    "issues": "https://github.com/walkor/webman/issues",
    "forum": "https://wenda.workerman.net/",
    "wiki": "https://workerman.net/doc/webman",
    "source": "https://github.com/walkor/webman"
  },
  "require": {
    "php": ">=7.2",
    "workerman/webman-framework": "^1.5.0",
    "monolog/monolog": "^2.0",
    "workbunny/webman-push-server": "^1.2"
  },
  "suggest": {
    "ext-event": "For better performance. "
  },
  "autoload": {
    "psr-4": {
      "": "./",
      "app\\": "./app",
      "App\\": "./app",
      "app\\View\\Components\\": "./app/view/components"
    },
    "files": [
      "./support/helpers.php"
    ]
  },
  "scripts": {
    "post-package-install": [
      "support\\Plugin::install"
    ],
    "post-package-update": [
      "support\\Plugin::install"
    ],
    "pre-package-uninstall": [
      "support\\Plugin::uninstall"
    ]
  }
}

测试的一些问题

1,前端无法订阅私有连接,报错:Received invalid JSON workbunny:d1b1a8016284207d7ca17c3f793c4aee24b75e78103f51108e2af2ec953f5120
2,push.Js接受的消息,没有判断到底是不是json就直接当做json解析
3,server后台,获取query参数的时候没有判断是否存在这个参数
4,api后台,无法使用报错:auth_key should be a valid app key
5,api更换委官方api,报错:"error":"Invalid auth_key",修改API.PHP的$this->_settings['base_path'] = '/apps/1‘后报错:{"error":"Invalid signature"}

TypeError: Argument 1 passed to Webman\Route::{closure}() must be an instance of Workbunny\WebmanPushServer\Server, instance of Closure given, called in /var/www/fj-oh/vendor/workbunny/webman-push-server/src/ApiService.php on line 9 0 and defined in /var/www/fj-oh/config/plugin/workbunny/webman-push-server/route.php:185

在服务端发布消息到客户端时,触发hook8002/apps/1/events?auth_key=workbunny&auth_timestamp=1670557139&auth_version=1.0&body_md5=815333cb3a7449 df17f843564824d1e4&auth_signature=195d9d8f622705fede774658622c75d2e4a95e6fb02e951a703174f2168bc98b"抛出的异常

代码示例:

             try {
                $pusher = new ApiClient(
                    'workbunny',
                    'U2FsdGVkX1+vlfFH8Q9XdZ9t9h2bABGYAZltEYAX6UM=',
                    '1',
                    ['host'=>"0.0.0.0:8002",'scheme'=>'http']
                );
                $pusher->trigger(
                    "private-d",
                    "client-a",
                    "23423432"
                );
            } catch (GuzzleException|ApiErrorException|PusherException $e) {
                dump($e);
            }

启动报错

目前环境:
PHP 8.1.27

composer 2.6.6

composer.json信息:
{
"name": "workerman/webman",
"type": "project",
"keywords": [
"high performance",
"http service"
],
"homepage": "https://www.workerman.net",
"license": "MIT",
"description": "High performance HTTP Service Framework.",
"authors": [
{
"name": "walkor",
"email": "[email protected]",
"homepage": "https://www.workerman.net",
"role": "Developer"
}
],
"support": {
"email": "[email protected]",
"issues": "https://github.com/walkor/webman/issues",
"forum": "https://wenda.workerman.net/",
"wiki": "https://workerman.net/doc/webman",
"source": "https://github.com/walkor/webman"
},
"require": {
"php": ">=7.2",
"workerman/webman-framework": "^1.5.0",
"monolog/monolog": "^2.0",
"workbunny/webman-push-server": "1.2.1",
"workerman/http-client" : "^1.0"
},
"suggest": {
"ext-event": "For better performance. "
},
"autoload": {
"psr-4": {
"": "./",
"app\": "./app",
"App\": "./app",
"app\View\Components\": "./app/view/components"
},
"files": [
"./support/helpers.php"
]
},
"scripts": {
"post-package-install": [
"support\Plugin::install"
],
"post-package-update": [
"support\Plugin::install"
],
"pre-package-uninstall": [
"support\Plugin::uninstall"
]
}
}

我这是拉的一个新webman项目

目前 php start.php start 后报错
image
image

客户端与客户端无法通信

  1. 两个client链接私有频道订阅同一个事件,无法通信(原因正在排查)。
  2. HookServer::publish('client-a', ["a" => 1]); 客户端无法收到消息。
  3. 服务端监听客户端的某一个事件缺少代码示例。

当客户端监听和发布事件未包含`pusher:`,`pusher_internal:`时需要异常处理

TypeError: Argument 1 passed to Workbunny\WebmanPushServer\Events\AbstractEvent::exists() must be of the type string, null given, called in /var/www/fj-oh/vendor/workbunny/webman-push-server/src/Events/AbstractEvent.php on line 70 a
nd defined in /var/www/fj-oh/vendor/workbunny/webman-push-server/src/Events/AbstractEvent.php:96

public static function factory(string $event): ?AbstractEvent
    {
        if(self::exists($preEvent = self::pre($event))){
            return self::$_eventObj[$preEvent] ?? (self::$_eventObj[$preEvent] = new self::$_events[$preEvent]($event));
        }
        return null;
    } 

当客户端监听和发布事件未包含pusher:,pusher_internal:时需要异常处理

某种情况下/vendor/workbunny/webman-push-server/src/HookServer.php:180会报错

ErrorException: Array to string conversion in /Users/chen/developer/webman-chat/vendor/workbunny/webman-push-server/src/HookServer.php:180
Stack trace:
#0 [internal function]: {closure}(2, 'Array to string...', '/Users/chen/dev...', 180)
#1 /Users/chen/developer/webman-chat/vendor/workbunny/webman-push-server/src/HookServer.php(180): Redis->xack('workbunny:webma...', 'workbunny:webma...', Array)

这是报错时打印出来的数据
string(43) "workbunny:webman-push-server:webhook-stream"
string(60) "workbunny:webman-push-server:webhook-stream:event-hook-group"
array(1) {
[1]=>
array(1) {
[0]=>
string(15) "1706934636800-0"
}
}
image

优化hook服务的消息储存

描述:

  1. Hook服务在极端情况(在重新将数据发回队尾时redis断开连接)下存在消息丢失的可能性;
  2. Hook服务在极端情况(在重新将数据发回队尾时redis断开连接)下可能存在空转情况;

计划:

  1. 计划对消费逻辑进行优化,将消费消息先ack后requeue;
  2. 计划增加消息本地储存,如使用sqlite储存发送失败的消息;
  3. 计划增加requeueTimer,用于将本地消息重入队列,保障业务;

win系统内存泄露,这是什么原因?

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 398462976 bytes) in D:\kok\yuanwebman\webman\vendor\workbunny\webman-push-server\src\WebhookHandler.php on line 43
Worker process terminated with ERROR: E_ERROR "Allowed memory size of 1073741824 bytes exhausted (tried to allocate 398462976 bytes) in D:\kok\yuanwebman\webman\vendor\workbunny\webman-push-server\src\WebhookHandler.php on line 43"
process D:\kok\yuanwebman\webman\runtime\windows\start_plugin.workbunny.webman-push-server.hook-server.php terminated and try to restart
plugin.workbunny.webman-push-server.hook-server none 1 [ok]

心跳机制循环方法内_getConnectionProperty的引用错误

Argument 1 passed to Workbunny\WebmanPushServer\Server::_getConnectionProperty() must be an instance of Workerman\Connection\TcpConnection, array, called in /var/www/fj-oh/vendor/workbunny/webman-push
-server/src/Server.php on line 442 and defined in /var/www/fj-oh/vendor/workbunny/webman-push-server/src/Server.php:327

sqlite数据库连不上

HookServer.php下面使用sqlite数据库链接使用方法找不到static::$app变量。Schema::connection

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.