WSPublish

Sends messages to a specific channel based on the filter criteria (which is a struct).

WSPublish(String channel, Object message); WSPublish(channel,message [,filterCriteria]); → returns True if the cache region exists.

This function requires Adobe ColdFusion. Not supported on Lucee, OpenBD, etc.

Argument Reference for the WSPublish function

channel

Required: Yes
Specific channel to which the server publishes its response.

message

Required: Yes
Response sent by the server to all clients subscribed to a specific channel.

filterCriteria

Required: No
Conditions to filter eligible clients that need to be notified for a given channel.

Examples sample code invoking the WSPublish function


Tag Syntax

Checking to see if the region is present in the cache

<cfscript> 
 if(isDefined('form.publish')) 
 WSPublish(#form.channel#, #form.message#); 
 </cfscript> 
 <cfform method='post'> 
 <cfselect name='channel'> 
 <option> 
 stocks 
 </option> 
 <option> 
 news 
 </option> 
 <option> 
 products 
 </option> 
 </cfselect> 
 Message: 
 <input id='message' name='message' type='text'> 
 <cfinput id='publish' name='publish' value='publish' type='submit'> 
 </cfform> 

Fork me on GitHub