You are here

function nodejs_broadcast_message in Node.js integration 7

Same name and namespace in other branches
  1. 8 nodejs.module \nodejs_broadcast_message()
  2. 6 nodejs.module \nodejs_broadcast_message()

Broadcast a message to all clients.

Parameters

string $subject:

string $body:

1 call to nodejs_broadcast_message()
nodejs_notify_broadcast_form_submit in nodejs_notify/nodejs_notify.module
The submit handler for the form, after validated.
1 string reference to 'nodejs_broadcast_message'
nodejs_drush_command in ./nodejs.drush.inc
Implements hook_drush_command().

File

./nodejs.module, line 175

Code

function nodejs_broadcast_message($subject, $body) {
  $message = (object) array(
    'broadcast' => TRUE,
    'data' => (object) array(
      'subject' => $subject,
      'body' => $body,
    ),
    'channel' => 'nodejs_notify',
  );
  nodejs_enqueue_message($message);
}