You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The interaction with docker API is a fairly rough implementation and is not very optimized. The server polls the API every 500 ms, publishing the response data to all open WebSockets if it changed since last time. There is probably a better way to look for changes in the Swarm that could be used in the future.
The way I think you can do this is with /events but from my experience, I suggest you use it as a trigger to pull changes asap rather than building from it.
That is to say the logic would be something like
/events?since=0s monitor to start listening for an event record
If event received or 2 seconds (as fallback) have passed pause the monitor
You noted in the README
The way I think you can do this is with /events but from my experience, I suggest you use it as a
trigger
to pull changes asap rather than building from it.That is to say the logic would be something like
/events?since=0s
monitor to start listening for an event recordYou can "reconsititute" some of the data using the events but I suggest you skip that notion first because some events may get dropped or the order may not be what you expect. (again based on experience writing this https://github.com/trajano/spring-cloud-demo/blob/rework/gateway/src/main/java/net/trajano/swarm/gateway/discovery/DockerEventWatcher.java)
The text was updated successfully, but these errors were encountered: