socket = {
let socket = io("http://localhost:5555");
socket.on('notebook-proxy', d => {
mutable req_latest = d;
mutable req_history.push(d);
handler(d).then(resp => {
socket.emit('notebook-proxy', {
id: d.id,
data: resp
});
});
});
invalidation.then(() => {
socket.off("notebook-proxy");
});
return socket;
}