Skip to content

Is there a way to insert an event as the first element in the queue of pending events? #81

Answered by nsk90
xgirones asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, no the library does not provide such an option.

https://github.com/nsk90/kstatemachine/blob/897195f421a6fd797eda539fd3f3c4e27883038d/kstatemachine/src/commonMain/kotlin/ru/nsk/kstatemachine/PendingEventHandler.kt#L21

Here is QueuedPendingIntentHendler, maybe you can copy it's implementation and add the required method as a public member.
But I am not sure that it is good design.

Could you provide a code sample of your usecase?
Why you cannot just call processEvent in required order?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@xgirones
Comment options

Answer selected by xgirones
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants