OpenKore console hangs after async task
Nobody has claimed this yet.
- Dominant language
- Perl
- Stars
- 1.5k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to extend OpenKore's functionality by writing a plug-in which makes use of asynchronous task whenever I use a skill.
Perl fork module is having a problem with OpenKore console.
Here's the simple code snippet from my plug-in
sub on_skill_use {
my (undef, $args) = @_;
print "Before doing async task.\n";
unless (fork) {
print "Doing something for 5 seconds without blocking OpenKore.\n";
sleep 5;
print "Task done.\n";
exit;
}
print "Continue with something else for now...\n";
}
The async task done just fine. OpenKore console printed something like this:
Before doing async task.
Continue with something else for now...
Doing something for 5 seconds without blocking OpenKore.
Task done.
After the last line which indicates async task has done, OpenKore console hangs.
It won't accept any direct input into the console and won't print anything out.
However if I try XKore and send command from chatbox like ;pl the result will be displayed in-game chatbox but not in OpenKore console. This means OpenKore is still working past that async task but the console display is hanged.
Or there's a better way of doing background, non-blocking or async task?
Appreciate any help.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the hang with the supplied on_skill_use handler and Perl fork example, then trace how the OpenKore console handles input and output after the child process exits. Compare the console behavior with the working XKore command path; done means the console continues accepting input and displaying output after the asynchronous task completes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- perl
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100