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

Add Coroutine Returns To ashita.tasks Functions #24

Open
atom0s opened this issue Sep 26, 2022 · 0 comments
Open

Add Coroutine Returns To ashita.tasks Functions #24

atom0s opened this issue Sep 26, 2022 · 0 comments
Labels
c: addon Category: Addon c: plugin Category: Plugin t: enhancement Type: Enhancement t: feature Type: Feature

Comments

@atom0s
Copy link
Contributor

atom0s commented Sep 26, 2022

Addon / Plugin Description

When creating a task from Ashita's ashita.tasks. addon functions, the actual created task/coroutine is not returned. It would be ideal to return the object so that users can easier control the coroutine (when applicable) such as killing it from outside the function.

For example:

local co = ashita.tasks.once(1, function ()
    -- do stuff here..
end);

co:kill(); -- Kill the coroutine, similar to coroutine.kill() from within the task function.

Or allow coroutine,kill() to accept an optional parameter of an existing coroutine/task.

@atom0s atom0s added c: addon Category: Addon c: plugin Category: Plugin t: enhancement Type: Enhancement t: feature Type: Feature labels Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: addon Category: Addon c: plugin Category: Plugin t: enhancement Type: Enhancement t: feature Type: Feature
Projects
None yet
Development

No branches or pull requests

1 participant