You are here

public static function Nodejs::sendMessage in Node.js integration 6

Same name and namespace in other branches
  1. 7 nodejs.module \Nodejs::sendMessage()
2 calls to Nodejs::sendMessage()
Nodejs::sendMessages in ./nodejs.module
nodejs_send_message in ./nodejs.module
Send a message immediately.

File

./nodejs.module, line 616

Class

Nodejs

Code

public static function sendMessage(StdClass $message) {
  self::initConfig();
  drupal_alter('nodejs_message', $message);
  $message->clientSocketId = str_replace("/", "", nodejs_get_client_socket_id());
  $request_method = 'POST';
  $request_retry = 3;
  $data = json_encode($message);
  return drupal_http_request(self::$baseUrl . 'nodejs/publish', self::$headers, $request_method, $data, $request_retry);
}