|
All of the long polling solutions I've used are asynch on the client. Obviously it's going to be asynch on the server as well since you probably want to be able to handle multiple clients.
To my thinking, synchronous long polling is the same thing as a synchronous server call - no polling involved.
The way I understand it (this is definitely not my area of expertise) the difference between long polling and push is that in long polling the client is maintaining an active TCP connection to the server. In push notifications, the client is only maintaining an active connection to a local socket. In the former case, all of those connections are going through a variety of network hardware that might have their own ideas about the lifespan of a TCP connection. In the later case, the connection is only open long enough to send the data.
The server side code is going to be a lot more complicated in a push scenario, but these days most libraries will let you set long polling or push notifications as a configuration option during the connection setup, then the consumption of messages is the same regardless which communication protocol you chose.
|
|
|
|
|
My 2c: I prefer push, as the notification handling on the client is repeatable pattern, and it leaves all the rules up to the server for when to sending updates. The server can then make decisions like throttling notifications -- consider, for example, that each client might be looking at different data and different pages, which might have notification rules associated with them. Certain clients might be considered higher priority (like admins.) Whatever.
And besides, a good pub/sub pattern is the cat's meow. Especially if it's a semantic pub/sub, where subscribers subscribe based on what semantics they are interested in, not just a raw data stream. But that's me.
Your concerns about push are of course quite legitimate, but again, because that is all handled on the server, it makes for a neater solution (and less Javascript, which should be, next to global warming control, the goal of the free world.)
Marc
Latest Article - Create a Dockerized Python Fiddle Web App
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
Rob Philpott wrote: what about an asynchronous long poll? Works for me. I prefer to it to push because it's simpler (fewer dependencies between client and server).
/ravi
|
|
|
|
|
You hit the nail on the head with your general assessment here, but I'd say that you need to expand your analysis to a finer grain than application specific. In a given application/service/whatever there is some data that is best for polling and some best for pushing. You're going to have to make that call on a case by case basis. Best here being completely subjective because best could be long term code maintenance or performance.
From an architectural standpoint in enterprise development my recommendation is to use push based systems at the surface and behind the scenes implement polling that feeds into it via adapters if polling makes the most sense for individual messages/data/traffic.
For push based systems you have to determine what underlying transport/technology is best suited too. There's Azure Service Bus, Google Pub/Sub, ZeroMQ, Tibco, etc. Each is going to have it's environment. Tibco is popular in financial worlds because it's got a low latency UDP option. Azure Service Bus is super easy to implement and is durable/reliable messaging. Google Pub/Sub has support for huge volume able to handle 1 mil + messages per second.
Global Service Bus Architecture in C#[^]
Unified Message Bus Framework - Part 1[^]
|
|
|
|
|
UI? Whats that...
|
|
|
|
|
Push is evil and should be avoided.
Ideally, the clients should connect to a database and execute a query, but that doesn't always work -- it could put too heavy a load on the server or the query could take too long to execute, etc.
There was a system I wrote a few years back that had to feed about a half-dozen client systems with an extract of the state of the system. What I wound up doing was to have a Windows Service create and publish the extract as an XML file on the network -- e.g. Extract.0.xml , Extract.1.xml ... Extract.9.xml . I think a new extract was made about every fifteen seconds or so. The clients would connect to the database to get the name of the current file then read that file.
|
|
|
|
|
...because I dropped my gf off at the airport which is only 10 minutes from work. Since my direct manager has been out of the office for the whole week and didn't give me any specific tasks (the task estimated for 30 hours took about 6), I've been taking unpaid time off this week (which is fine with me, being a contractor, got lots of stuff done at home, wrote an article about Docker, spent yesterday doing fun stuff with my gf, etc) but here I am, still with nothing to do.
Checked my email. Nothing going on.
I'll probably just go home.
Marc
Latest Article - Create a Dockerized Python Fiddle Web App
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
Crash the server.
Then you can heroically come in really early and fix it. Instant brownie points!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
BCFH (Bastard Contractor From Hell)?
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.
--Winston Churchill
|
|
|
|
|
PCFH (Practical Contractor From Hell)
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Made that once.
Then could not fix it.
Painful moment.
|
|
|
|
|
|
OriginalGriff wrote: Crash the server.
Great idea! Sounds like f
Latest Article - Create a Dockerized Python Fiddle Web App
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
You truly are a man after my own fart heart fart heart!
Friday morning decision making can be tough.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
If that's what you were looking for.
"It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[ ^]
|
|
|
|
|
lw@zi wrote: If that's what you were looking for.
Hehe. Thanks. I decided I would spend the time looking like I was working and learn WPF from scratch. I've never actually sat down and worked through a tutorial on it. The link is pretty good, I've learned much already and I'm only 3 hours into it (been trying various things too and taking various notes, not just speed reading each page.)
5 hours to go.
Marc
Latest Article - Create a Dockerized Python Fiddle Web App
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
Shall we swap? I got this and next week full of giving trainigs each session 3 hours at last. Sometimes 2 sessions a day
Rules for the FOSW ![ ^]
if(this.signature != "")
{
MessageBox.Show("This is my signature: " + Environment.NewLine + signature);
}
else
{
MessageBox.Show("404-Signature not found");
}
|
|
|
|
|
HobbyProggy wrote: I got this and next week full of giving trainigs each session 3 hours at last. Sometimes 2 sessions a day
Depending on the nature of the trainings, I would definitely swap with you!
(Meaning, if it's stuff like teaching C#, Linq, SQL, so forth, yeah, cool. If it's doing training for some crappy piece of in-house software, then not so cool. )
Marc
Latest Article - Create a Dockerized Python Fiddle Web App
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
Well i'd say it's not crappy but who knows if i am a good programmer
Rules for the FOSW ![ ^]
if(this.signature != "")
{
MessageBox.Show("This is my signature: " + Environment.NewLine + signature);
}
else
{
MessageBox.Show("404-Signature not found");
}
|
|
|
|
|
"Black and white star is a mix of earl and sultan." (4,6)
Good luck
Andy B
modified 12-May-17 6:25am.
|
|
|
|
|
STAN LAUREL - Anagram of "EARL" and "SULTAN"
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Too easy I suppose, but well done anyway. Your turn on Monday.
Andy B
|
|
|
|
|
|
|
They did go into an area, near the end, which begged attention: like vision, there's no reason to expect humans to have emphasis on the same odors as various other species, nor they with one another. Evolution will get rid of the wasted and emphasize the important characteristics.
Noting that human females had better olfactory capabilities than human males - confirms what I've observed from Mrs. Wife. Also, in the back of my mind, there is something about human females having sense of smells that very with their menstrual cycle. Sometimes, per these remembered 'facts', a human female can be many orders of magnitude more sensitive to certain smells.
In conclusion: (and obviously the gist of the LA Times article) It's not all attributable to a lack of sense-of-humor that causes most women to shun poop and fart jokes - they just don't appreciate these things as men do.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|