-
Notifications
You must be signed in to change notification settings - Fork 419
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
feat: lazy static runtime in python #2424
feat: lazy static runtime in python #2424
Conversation
27a1f9c
to
e67996a
Compare
Did you know! Since Rust 1.70 Since the crate is already there I don't mind its use, but thought I would mention it 😄 since the |
@rtyler thanks for pointing that out! :) didn't know that existed, let me make the change |
@rtyler @wjones127 I changed it to use OnceLock and refactored the lifetime in other areas where the runtime is used |
python/src/filesystem.rs
Outdated
@@ -25,7 +24,7 @@ pub(crate) struct FsConfig { | |||
#[derive(Debug, Clone)] | |||
pub struct DeltaFileSystemHandler { | |||
pub(crate) inner: Arc<DynObjectStore>, | |||
pub(crate) rt: Arc<Runtime>, | |||
pub(crate) rt: Arc<&'static Runtime>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's a static, I don't think it even needs to hold this as part of the struct. Can just reference the global static in the methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or you mean to not pass it through the struct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wjones127 I removed it from the structs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Description
As suggested by @wjones127 to create a lazy static runtime, supersedes this PR: #1950