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

Events called by SongPlayer's loop can't be cancelled #55

Open
koca2000 opened this issue Aug 22, 2020 · 1 comment
Open

Events called by SongPlayer's loop can't be cancelled #55

koca2000 opened this issue Aug 22, 2020 · 1 comment

Comments

@koca2000
Copy link
Owner

When an event is called from SongPlayer's loop which is in async thread it can't be cancelled. Affected events are: SongLoopEvent and SongDestroyingEvent.

SongPlayer also continues playing the Song without waiting for event listeners of events bellow to finish their execution. Affected events are: SongStoppedEvent, SongNextEvent and SongEndEvent. For example when SongPlayer is paused in SongNextEvent it plays first few notes of the next Song before it's paused.

It is caused by schedulling the events execution in order to execute them in synchronized thread (not async with server main thread).

@ishland
Copy link
Contributor

ishland commented Aug 23, 2020

Simply calling event off-thread solves this

koca2000 added a commit that referenced this issue Sep 5, 2020
@koca2000 koca2000 added this to the 2.0 milestone Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants