johnameyer / cards-ts

A card game framework and various games in Typescript. The framework allows for bot development and playing card games in the terminal or in a browser.
MIT License
7 stars 2 forks source link

Clean up async vs sync handlers #84

Open johnameyer opened 3 years ago

johnameyer commented 3 years ago

Currently, the handlers and intermediaries use a system of returning a promise to indicate that the data has been sent wherever, and uses the response queue to push promises or synchronous results. However, this doesn't particularly make sense for Euchre, as the intermediary has two distinct sends (maybe a generator at the intermediary level?). As an initial implementation, we may just clear up the ordering of events or prevent the game from continuing before all grouped events are processed (and remove the undefined event for Euchre).

johnameyer commented 10 months ago

Likely we can look to resolve this in the near term by preventing these doubled messages