-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
Allow erroring a Thread #500
Comments
I'm not sure I understand the question. |
Actually never mind on this specific issue. I do have one other issue though. In order for my scheduler to correctly work, it needs to preload arguments to the thread (see https://github.com/Scythe-Technology/Zune/blob/199510ea089412e776d1c25d0374f86d6a58fadc/src/core/standard/task.zig#L110 for a zig example, it does a xpush). Can such an API be exposed in mlua if possible to allow preparing arguments directly in thread without resuming it. If this isnt possible, could thread state be exposed somehow so xpush etc can be done manually |
Have you tried OR to manipulate the thread stack directly you can always use raw api, through
|
In order to do the second one, I need access to pop_error, check_stack, StackGuard and protect_lua! in mlua to do manual thread resumption. I also may need access to |
You should not need any of the internal functions.
This is right, it's a hidden private api for internal use. -- |
I am trying to preload arguments to thread stack and then resume the preloaded/prepared thread in my scheduler to better match Roblox's behaviour in their own task scheduler. For example:
This should error due to delay adding/xpushing the "b" to thread stack and then returning the created thread. Then on resume, it should just resume the thread without any further stack moves |
I'm not familiar with roblox interface, however this looks quite weird. Are you sure that you can |
The point here is to match the exact behaviour that pretty much every other (Roblox/Zune) scheduler does which is to error out here bc the argument "b" is first pushed, and then doing spawn here causes an error. Right now it continues but weirdly emits out a multivalue |
The exact behaviour of official Roblox studio is panic with error:
Trying instead of
Which means it does not push anything to the thread. This delay behaviour can be replicated roughly with
|
Oh thanks a lot for the help! |
BTW, someone tested it on that sample and they got 2 errors in Roblox studio involving trying to call a string argument as if it was the last pushed argument.
|
My bad. I personally think that roblox |
Can an API be added to allow erroring a yielded Thread etc. For use case, I need this for my scheduler to override the builtin behaviour of create_async_function
The text was updated successfully, but these errors were encountered: