You are here

class NodejsSubscriber in Node.js integration 8

Hierarchy

  • class \Drupal\nodejs\EventSubscriber\NodejsSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface

Expanded class hierarchy of NodejsSubscriber

1 string reference to 'NodejsSubscriber'
nodejs.services.yml in ./nodejs.services.yml
nodejs.services.yml
1 service uses NodejsSubscriber
nodejs.subscriber in ./nodejs.services.yml
Drupal\nodejs\EventSubscriber\NodejsSubscriber

File

src/EventSubscriber/NodejsSubscriber.php, line 12

Namespace

Drupal\nodejs\EventSubscriber
View source
class NodejsSubscriber implements EventSubscriberInterface {
  protected $nodejs;
  public function __construct(Nodejs $nodejs) {
    $this->nodejs = $nodejs;
  }
  public function sendMessages(PostResponseEvent $event) {
    $this->nodejs
      ->sendMessages();
  }

  /**
   * {@inheritdoc}
   */
  static function getSubscribedEvents() {
    $events[KernelEvents::TERMINATE][] = array(
      'sendMessages',
      40,
    );
    return $events;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
NodejsSubscriber::$nodejs protected property
NodejsSubscriber::getSubscribedEvents static function Returns an array of event names this subscriber wants to listen to.
NodejsSubscriber::sendMessages public function
NodejsSubscriber::__construct public function