Send a deadline as well as a timeout #100
Replies: 2 comments
-
I really like this concept. Definitely a feature for more advanced Battlesnake devs to take advantage of, so I like how the simplified timeout parameter is left int the payload. |
Beta Was this translation helpful? Give feedback.
-
Is there a risk that clock drift between the server running the game and the snake dev's server throws off the calculation? Or is that something we'd just assume you deal with yourself however you see fit? That might factor into the resolution a bit too - is there a point in using nanos vs. micros if the most accurate time remaining you could estimate from this might be closer to the micros range? |
Beta Was this translation helpful? Give feedback.
-
Brief Line, Up Front
Today the
game
object sends a target timeout that a given game is expecting. This is a relative time but doesn't come with a basis, so some guesswork is required to work out how long a given request should process for. I think it would be cool for the battlesnake server to send a deadline, and a request origination time, to make it easier to work out when a given server needs to returnImplementation Detail
Modify the game object to look like:
Why?
I think this would be a clarifying signal to snake devs that enables two things more cleanly than is possible today:
Instant::now() - sent_at_micros
, we get a clean estimation of the latency to the battlesnake server, enabling reasonable estimation of when to stop request processingAlternatives
Anyway, this is the start of the discussion, really would love thoughts back :D
Beta Was this translation helpful? Give feedback.
All reactions