-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
Use Ref for active electron process, add some Base methods. #230
Conversation
Some things I'd like to change:
|
src/AtomShell/process.jl
Outdated
global _shell | ||
_shell ≠ nothing && active(_shell) && return _shell | ||
_shell = init(debug = debug) | ||
_active_electron_process = Ref{Union{Electron, Nothing}}(nothing) |
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.
This can be marked const
for a significant performance improvement. I also personally prefer ALL_CAPS
for global constants, but if you're happy with _leading_underscore
notation that's fine.
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.
Yep, thanks.
I think I personally like the lowercase here because it's const
but not immutable (though I think I've been inconsistent with that in other places).
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.
:) Don't forget to make this const before merging
_active_electron_process = Ref{Union{Electron, Nothing}}(nothing) | |
const _active_electron_process = Ref{Union{Electron, Nothing}}(nothing) |
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, thanks!
src/AtomShell/process.jl
Outdated
`Electron` instance. If there *is* an active instance, this function returns | ||
that instance without regards to whether or not the `debug` setting matches. |
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.
If you want to be super thorough, we could check if the requested debug settings match the existing debug settings, and if not, print a warning or something?
src/AtomShell/process.jl
Outdated
global _shell | ||
_shell ≠ nothing && active(_shell) && return _shell | ||
_shell = init(debug = debug) | ||
_active_electron_process = Ref{Union{Electron, Nothing}}(nothing) |
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.
:) Don't forget to make this const before merging
_active_electron_process = Ref{Union{Electron, Nothing}}(nothing) | |
const _active_electron_process = Ref{Union{Electron, Nothing}}(nothing) |
There are some parts of the Blink API that I'd like to change around a bit. I think there are parts that are "cludgy" and lead to some strange errors (à la #191).
If it's okay, I'd like to rework some parts of the API with the strategy of maintaining backward compatibility and with the end goal of possibly removing some of those deprecations and releasing a new major version.
This is related to the work I've been doing trying to whip WebIO into shape. The end goal is to make everything in the JuliaGizmos universe work together more seamlessly.