It appears to me that the problem is not with the tick event, but with the fact that you model the player commands as a Behavior
.
If you think denotationally and imagine that a behavior is a time-varying value Behavior a = Time -> a
, does it make sense to model player commands in this way? What is the player command in, say, the time frame between 3s
and 4s
? Does the argument you give to fromPoll
respect these semantics?
The thing is that grabCommands
has a serious side effect: calling it removes the commands from the channel, so it is not even idempotent. Also, it blocks when there is no command available. I think that this is ultimately the reason why the tick event doesn't work: the network is blocked trying to execute the fromPoll
action. However, the underlying problem is more profound: the right way to model player commands is to use an Event
, not a Behavior
.