Invoking individual WebSocket connections has been supported since Zato 3.0 and Zato 3.1 adds new functionality on top of it - message broadcasting - which lets one notify all the clients connected to a particular channel. Here is how to use it.
Let's say that there is a WebSocket channel such as the one here:
In the context of broadcast messages, the most important part of this definition is its name - below, we will be sending messages to all clients connected to that particular channel by its name.
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from zato.server.service import Service
# Channel to invoke
name = 'My WSX API Channel'
# Get a handle to the channel object
channel = self.wsx.channel[name]
# Message to send
data = 'Hello from Zato'
# Broadcast this message to all clients connected to that channel
Note that the messages are always sent in background - they are treated as asynchronous messages and Zato does not wait for any potential response from the clients.