java - Notify client that server has finished processing in firebase -
for our application,
- we using angularjs our front-end framework , java @ server-side in our application.
- we want integrate our application firebase, have following issue regarding it.
now, let's assume following scenario:
- the client changes object stored @ firebase url
- the server listens change , start processing on object
- we can assume process takes 5 10 seconds.
- however, client changes state without waiting response server.
our question is: how server notify client completion of processing?
please guide how implement functionality. there built in mechanism in firebase this?
just server listens change in database, client can same. when client changes object in database, can create new property meant server signal when finished processing. client listens changes property, , server changes when done processing. data structure this:
{ serverjobs: { job1: { input: { // client's input job }, finished: false }, job2: { input: { // client's input job }, output: { // server's output job } finished: true } } }
the server listen serverjobs
, , start working on job when client adds it. client supplies whatever data server needs each job input
. client listens job's finished
value. when server finishes job, sets finished
value true
, supplies job's result output
. client notices change of finished
value , can take output
, act accordingly.
Comments
Post a Comment