emit('message', [Message::parse((string)$msg)]); }); // Create a new promisor $deferred = new Deferred; $deferred->resolve(null); return $deferred->promise(); } }