Decoupling websocket connection and task service.