Skip to content

Conversation

pankgeorg
Copy link
Member

No description provided.

@pankgeorg pankgeorg requested review from Pangoraw and fonsp February 17, 2025 15:26
Initiate the worker auto gc every `ENV["MALT_AUTO_GC_SECONDS"]` or 900 seconds.
"""
function autogc(w::Worker)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can call this once, to turn on the auto gc loop, right? And subsequent calls are ignored? I think that's nice API!

We should document this, and maybe a different name would make this more clear. E.g. start_background_auto_gc (I love long names but feel free to get creative)

"""
Malt.requestgc(w::Worker)
Request a garbage collection on the worker `w`. This is a non-blocking call (on the worker).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could add in these docs: "For a blocking GC, you can use Malt.remote_call_wait(GC.gc, w)."

I think the sentence This is a non-blocking call (on the worker). could be expanded a bit more, and be more technical about timing and throttling


const _channel_cache = Dict{UInt64,AbstractChannel}()
const _gc_event = Base.Event()
const _gc_task = Threads.@spawn begin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you consider Threads.@spawn :interactive? I don't know which is better here

Copy link
Member

@fonsp fonsp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really nice!

We should check whether this works and is useful (before spending time on the finishing steps). So either in Pluto, PlutoSliderServer or Quarto, let's apply this and check that it is beneficial.

I think this still needs a test (at least a sanity test that just calls the functions). Maybe you could check those @debug logs to see if throttling works?

We also need to update the Documenter.jl page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants