I am rewriting app based on angular 1 to angular 2. In my app there is websockets. Each time when app gets message from websocket it runs zone.runTask
(because websocket.onmessage
is async function) and in the end it update $digest
circle from angular1. This is normal behaviour. But app gets ~3000 websocket messages per second and zonejs
runs with $digest
circle 3000 times per second and it spoils performance up to freeze.
I want to exclude websocket.onmessage
from zonejs
control, wait untill all messages will be downloaded and then run zonejs
using setTimeout
function.
So my questions are:
Is there a way to exclude websocket.onmessage
from zonejs
control?
Or how to get back standart websocket.onmessage
behaviour without monkey patching by zonejs
?