Skip to content

Basic event numbering#16

Open
vivlim wants to merge 1 commit intomasterfrom
vivlim/event-numbering
Open

Basic event numbering#16
vivlim wants to merge 1 commit intomasterfrom
vivlim/event-numbering

Conversation

@vivlim
Copy link
Collaborator

@vivlim vivlim commented Sep 17, 2017

No description provided.

@vivlim vivlim requested a review from lifning September 17, 2017 04:50
message = await asyncio.get_event_loop().run_in_executor(None, self.bgThreadGetOutboundMemoryReads)
print("sending a message: {}".format(message))
pprint.pprint(message)
visualization.textlog.log_text(f"Sending event with num {self.currentEventNumber}")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

once we have 'smart' strategies we should describe what the event actually was here too

messageString = await websocket.recv()
message = ast.literal_eval(messageString)
num = message.get('event_number', -1)
if num > self.currentEventNumber:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's more than 1 bigger, we might wanna log something as well... since we'll be skipping events and ignoring them if they do come in later. eventually we'll want a "catch-up" path. we might also want a buffer of some small number (3?) of events in case a few come in out of order, before resorting to skipping.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alternatively we might decide to make the IGameSync unconditionally include every strategy's memory blocks in each update when any of them have changed, so skipping events is OK but the overall bandwidth is higher

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants