nushell/crates/nu-plugin
Devyn Cairns 37a9f21b2a
Sync with the plugin garbage collector when setting config (#12152)
# Description
This causes `PersistentPlugin` to wait for the plugin garbage collector
to actually receive and process its config when setting it in
`set_gc_config`.

The motivation behind doing this is to make setting GC config in scripts
more deterministic. Before this change we couldn't really guarantee that
the GC could see your config before you started doing other things.

There is a slight cost to performance to doing this - we set config
before each plugin call because we don't necessarily know that it
reflects what's in `$env.config`, and now to do that we have to
synchronize with the GC thread.

This was probably the cause of spuriously failing tests as mentioned by
@sholderbach. Hopefully this fixes it. It might be the case that
launching threads on some platforms (or just on a really busy test
runner) sometimes takes a significant amount of time.

# User-Facing Changes
- possibly slightly worse performance for plugin calls
2024-03-12 10:50:13 +01:00
..
src Sync with the plugin garbage collector when setting config (#12152) 2024-03-12 10:50:13 +01:00
Cargo.toml Support for all custom value operations on plugin custom values (#12088) 2024-03-12 10:37:08 +01:00
LICENSE Fix rest of license year ranges (#8727) 2023-04-04 09:03:29 +12:00