You are here

public function Nodejs::sendMessage in Node.js integration 8

1 call to Nodejs::sendMessage()
Nodejs::sendMessages in src/Nodejs.php

File

src/Nodejs.php, line 95

Class

Nodejs

Namespace

Drupal\nodejs

Code

public function sendMessage(\StdClass $message) {
  if (!$this
    ->safeNodeServerVersion()) {
    return FALSE;
  }
  $this->moduleHandler
    ->alter('nodejs_message', $message);
  $options = [
    'method' => 'POST',
    'body' => Json::encode($message),
  ];
  return $this
    ->httpRequest('nodejs/publish', $options);
}