angularjs - HTTP response following long process -


the current project in node.js expressjs framework. have application client/prospect information, authenticated users allowed modify database , initiate long-running processes on server. example, printing 30 pg document 1 process.

the application user needs 2 main things:

  1. a response when process begins.
  2. a response (notification) when process ends.

we handle need #1 in standard express fashion ensuring process starts followed res.json({msg: 'process started']); angular front end. need #2 handed email user initiated process process status report.

i improve how handle need #2. specifically, send json string user display in interface.

questions:

  1. is possible on http?
  2. does functionality exist within express or well-know middleware.

assuming 1 & 2 false. solution run tcp socket server maintain socket required users. when process ends message sent user status update. can comment on issues solution presents?

yes both 1 , 2. seek achieve here push server client. need pretty ubiquitous in web applications , there have been various solutions on years various fancy names. might read on ajax, comet, long-polling, websockets.

for node application, take @ socket.io. in nutshell, framework abstracts complexities of ajax, websockets, etc. single api. put way, socket.io gives bi-directional communications between node application , front end.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -