}
}
+ /**
+ * Request a maximum timeout for listeners before the next idle period.
+ *
+ * @return integer Maximum timeout
+ */
public function timeout() {
- return 1;
+ if ($this->messageWaiting) {
+ return 1;
+ } else {
+ return 120;
+ }
}
/**
$data = unserialize($wm->data);
if (!$this->send_raw_message($data)) {
- $this->plugin->enqueue_outgoing_raw($data);
+ $this->plugin->enqueue_outgoing_raw(
+ array(
+ 'type' => 'message',
+ 'prioritise' => $data['prioritise'],
+ 'data' => $data['data']
+ )
+ );
}
$wm->delete();