Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pending tasks queue unused #137

Open
joprice opened this issue Sep 18, 2020 · 0 comments
Open

pending tasks queue unused #137

joprice opened this issue Sep 18, 2020 · 0 comments

Comments

@joprice
Copy link
Contributor

joprice commented Sep 18, 2020

It looks like the pending tasks queue is unused, since it is always set to an empty list when it is empty, and then set back to empty afterwards. Was this intended to be written differently to queue up the actions and batch them?

let rec handler msg =
match !pending with
| None ->
let () = pending := ((Some ([]))[@explicit_arity ]) in
let newModel = pumperInterface.handleMsg (!model) msg in
let () = model := newModel in
(match !pending with
| None ->
failwith
"INVALID message queue state, should never be None during message processing!"
| ((Some ([]))[@explicit_arity ]) -> pending := None
| ((Some (msgs))[@explicit_arity ]) ->
let () = pending := None in List.iter handler (List.rev msgs))
| ((Some (msgs))[@explicit_arity ]) ->
pending := ((Some ((msg :: msgs)))[@explicit_arity ]) in

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

No branches or pull requests

1 participant