What hook exist in Base/Core/stdlibs?
By hooks I mean places you can register an arbitrary function to run whenever something occurs.
Ones I am aware of out of hand:
finalizer(f, x)
runs when object x
has no program-accessible references
atexit
runs when julia exits (docs)
atreplinit
runs just prior to when the REPL inializes (docs)
Base.package_callbacks
runs whenever a module (or is it package?) is loaded (docs
Are there any others?
(and: no, I don’t intend to use this for evil. Would I do something like that?)
12 Likes
I believe that, when run, Base.set_active_project(...)
will call callbacks.
I don’t remember off the top of my head how those callbacks are registered.
Revise
also uses Base.include_callbacks
, which AFAIU contains a list of callbacks that are run when any file is include
d somewhere.
1 Like
jar1
5
See “Other global state in Base”
1 Like