-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
Callable::from_local_fn()
+ Callable::from_sync_fn()
#965
Conversation
Callable::from_local_fn()
+ Callable::from_sync_fn
Callable::from_local_fn()
+ Callable::from_sync_fn()
API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-965 |
I'd argue for a more relaxed approach:
Rationale:
|
Hm, that's a more general philosophical question about how we handle errors. Often, godot-rust comes with a "ergonomic but fatal" option ( So if I understand your argument right, "runs on wrong thread" is not an error that should be treated the same as other errors, like bad type conversions. Probably you're right -- the other argument to that is that over time, we may want to remove certain runtime checks in Release mode, for performance. I was actually considering to add a method to
And maybe Threading in godot-rust still has several unknowns (#18), and it's very hard to achieve consistent yet useful guarantees given how loosely Godot itself handles threads. Ideally we can achieve at least internally consistent behavior (between |
That does sound nice. |
Closes #588.
Deprecates
Callable::from_fn()
which requiredSend
+Sync
bounds.You can now choose:
from_local_fn()
.from_sync_fn()
.Send
+Sync
.experimental-threads
crate feature.Also fixes an issue with FFI threading check (if a panic was already in progress, the next check would fail hard, aborting without ever printing the first panic's message).