承接 zvse/private_message_messenger_nodejs 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

zvse/private_message_messenger_nodejs

Composer 安装命令:

composer require zvse/private_message_messenger_nodejs

包简介

Instant updates for private messages without polling

README 文档

README

Pure fork of the https://github.com/jez500/Private-Message-NodeJS with the package name change

Private Message NodeJS

Instant updates and notifications for the Private Message Messenger module module without the need for polling.

This listens for private message thread updates and uses the drupal nodejs module to trigger updates to the UI and provide notifications for members of the changed thread.

NOTE: This is different to the Private message nodejs module.
This module was written to be paired with Private Message Messenger and and they both work well together.

How it normally works

Polling is the standard method of checking for message updates, this means a website will hit your server every XX seconds to see if anything has changed. This is not ideal as it puts lots of extra load on your server with all those requests, it also means a user will have to wait XX seconds for a reply. If polling is disabled, it would require a full page reload!

Why this is a huge improvement

  • No polling slowing down your browser
  • No unnecessary constant load on your server
  • Message threads immediately show new messages
  • In-page browser notifications when new messages are recieved (optional).

Requirements

Not a requirement, but this module has been specifically made to work with Private Message Messenger, if you are not using this, you will have to implement your own integration (see below for hooking into a notification).

Hooking into a notification

This module triggers an event on $(window) so all you have to do is listen to window for the event. Eg:

$(window).on('pm:threads:poll', function(event, data) {
  console.log(data);
  alert('New message from ' + data.ownerName);
});

Installation

Just type

composer require zvse/private_message_nodejs

And... drush en -y private_message_nodejs

2. Ensure you have NodeJS setup and working

See basic guide here. Steps I took at time of writing:

  • Install NodeJS v4.2.6 on your server
  • npm install drupal-node.js should be outside of docroot and will default to node_modules folder
  • cd node_modules/drupal-node.js and cp nodejs.config.js.example nodejs.config.js
  • Edit nodejs.config.js with your config, at a bare minimum set serviceKey to a random value, I also had to update the backend.host with the correct url for my drupal site
  • Start the server node app.js also look at using forever
  • In your drupal site, go to /admin/config/nodejs/settings and add the serviceKey you created above. Other settings should match your nodejs.config.js file (only thing I need to change was the host)
  • The status report page /admin/reports/status should indicate drupal has found the NodeJS server

NOTE 1: At time of writing this, the "stable" release of drupal/nodejs (v1.1) was actually quite broken, the 1.x-dev version is far more robust.

NOTE 2: For https support with drupal/nodejs you will likely need this patch.

3. Notifications - Optional, but handy for testing

Enable the nodejs_notify module, open a few browser windows and go to /admin/config/nodejs/broadcast in one of them to send a message to all the others. If that works, this module should be ready to go!

The nodejs_notify module also provides jGrowl which is used for notifications in this module. If you don't want nodejs_notify enabled but still want notifications then include jGrowl manually

4. Disable polling

You don't need it anymore, set the Ajax refresh rate for messenger blocks and config to 0 so it wont poll anymore.

5. Test

If you are using Private Message Messenger, Open 2 different browsers, each logged in as different users, send a message from one user to another, you should see threads and blocks instantly update and a notification displayed.

Author

This module is created by Jeremy Graham but wouldn't be possible without all the great work done by Jaypan on the Private Message module

zvse/private_message_messenger_nodejs 适用场景与选型建议

zvse/private_message_messenger_nodejs 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 22 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 10 月 16 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「messaging」 「drupal」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 zvse/private_message_messenger_nodejs 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 22
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 10
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 3
  • 开发语言: JavaScript

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2019-10-16