Teilweise ist das einfach nur ein anderer Content-Type. Für JSON als Stream gibt es leider keinen einheitlichen, standardisierten Weg.
Spats kommen bei dem Streaming Endpoint („spats“ im Plural) alle 30 Sekunden. Sollte aber reichen, da die Prediction mindestens eine Minute in die Zukunft geht und das alles recht statisch ist. Man kann mehrere intersection Parameter angeben. Das ist auch der Grund warum es bislang kein Long-Polling gibt, da der Use-Case normalerweise war eine ganz Reihe von Intersections zu abonnieren (der Endpoint „spat“ (im Singular) am Ende ist relativ neu).
Es gibt verschiedene (je nach Client mehr oder weniger gut funktionierende) Push Varianten bei denen die Verbindung offen bleibt:
plainPush
jsonPush
jsonEventStream
serverSentEvents
ndJson
jsonLines
jsonStream
jsonSeq
Teilweise ist das einfach nur ein anderer Content-Type. Für JSON als Stream gibt es leider keinen einheitlichen, standardisierten Weg.
Spats kommen bei dem Streaming Endpoint („spats“ im Plural) alle 30 Sekunden. Sollte aber reichen, da die Prediction mindestens eine Minute in die Zukunft geht und das alles recht statisch ist. Man kann mehrere intersection Parameter angeben. Das ist auch der Grund warum es bislang kein Long-Polling gibt, da der Use-Case normalerweise war eine ganz Reihe von Intersections zu abonnieren (der Endpoint „spat“ (im Singular) am Ende ist relativ neu).