-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add AsyncAdapter #7
Conversation
This looks like it could be extremely useful to me! |
API LGTM so far. lmk if you want feedback on the implementation when it's ready and I can do a more thorough review. Thanks for this! It's gonna be awesome. :D |
AsyncAdapter can be used to handle Line, Options, and Command events in an asynchronous manner, similar to the main Yarn Spinner implementation. AsyncAdapter is a DialogueHandler that can be passed to VirtualMachine. Then, the user can supply an AsyncDialogueHandler. When Line, Options, or Command is called on the AsyncDialogueHandler, the VM execution is paused, and can continue by calling AsyncAdapter.Go, GoWithChoice, or can be stopped entirely with AsyncAdapter.Abort.
@kalexmills have at it! Keen to hear your thoughts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few questions. LGTM
Aside from consistency, pausing on other events may be useful to show animations, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks. :D
AsyncAdapter
can be used to handle events in an asynchronous manner, similar to the main Yarn Spinner implementation.AsyncAdapter
is aDialogueHandler
that can be passed toVirtualMachine
. Then, the user can supply anAsyncDialogueHandler
. Once any of the messages are called on theAsyncDialogueHandler
, the VM execution is paused, and can continue by callingGo
orGoWithChoice
onAsyncAdapter
, or can be stopped entirely withAbort
.