Nchan 实时消息内置变量

 
以下参考官方文档:
 
  • $nchan_channel_id
    The channel id extracted from a publisher or subscriber location request. For multiplexed locations, this is the first channel id in the list.

  • $nchan_channel_id1, $nchan_channel_id2, $nchan_channel_id3, $nchan_channel_id4
    As above, but for the nth channel id in multiplexed channels.

  • $nchan_subscriber_type
    For subscriber locations, this variable is set to the subscriber type (websocket, longpoll, etc.).

  • $nchan_publisher_type
    For publisher locations, this variable is set to the subscriber type (http or websocket).

  • $nchan_prev_message_id, $nchan_message_id The current and previous (if applicable) message id for publisher request or subscriber response.

  • $nchan_channel_event For channel events, this is the event name. Useful when configuring nchan_channel_event_string.

  • $nchan_version Current Nchan version. Available since 1.1.5.

Additionally, nchan_stub_status data is also exposed as variables. These are available only when nchan_stub_status is enabled on at least one location:

    • $nchan_stub_status_total_published_messages
    • $nchan_stub_status_stored_messages
    • $nchan_stub_status_shared_memory_used
    • $nchan_stub_status_channels
    • $nchan_stub_status_subscribers
    • $nchan_stub_status_redis_pending_commands
    • $nchan_stub_status_redis_connected_servers
    • $nchan_stub_status_total_ipc_alerts_received
    • $nchan_stub_status_ipc_queued_alerts
    • $nchan_stub_status_total_ipc_send_delay
    • $nchan_stub_status_total_ipc_receive_delay
 

posted on   荣锋亮  阅读(305)  评论(0编辑  收藏  举报

编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示