nchan_subscriber_info

The `nchan_subscriber_info` directive is used to configure the handling of subscriber information in Nchan, a pub/sub server for NGINX.

Syntaxnchan_subscriber_info;
Defaultnone
Contextlocation
Argumentsnone

Description

The nchan_subscriber_info directive allows a location to respond with information about the current subscribers on a channel. It does so without requiring any additional arguments, meaning it simply needs to be declared for it to take effect. When this directive is included in a location context, it enables Nchan to return details about each subscriber such as their connection health and messages they are currently receiving. This can be useful for debugging or monitoring subscriber activity. It is worth noting that the handling of this information is performed asynchronously, ensuring that the performance of the server remains unaffected even when subscriber data is being queried.

In the context of scalability, knowing how many subscribers are connected, or other attributes of their connections, can help administrators assess the load and performance of the pub/sub system. This directive does not alter the core functionality of how messages are published or received but serves as an additional tool for introspection. It's an excellent fit within the Nchan module that aims to provide flexible, real-time messaging solutions for web applications, allowing developers to gain insights into ongoing communications between publishers and subscribers.

Config Example

location /subscribe {
    nchan_subscriber_info;
    nchan_subscriber_channel_id my_channel;
}

Ensure the nchan_subscriber_info directive is defined within a valid location context.

Remember that this directive does not accept any parameters, so including arguments will cause configuration errors.

← Back to all directives