nushell/crates/nu-command
Renan Ribeiro 2d868323b6
Inter-Job direct messaging (#15253)
# Description

This PR implements an experimental inter-job communication model,
through direct message passing, aka "mail"ing or "dm"ing:



- `job send <id>`: Sends a message the job with the given id, the root
job has id 0. Messages are stored in the recipient's "mailbox"
- `job recv`: Returns a stored message, blocks if the mailbox is empty
- `job flush`: Clear all messages from mailbox

Additionally, messages can be sent with a numeric tag, which can then be
filtered with `mail recv --tag`.
This is useful for spawning jobs and receiving messages specifically
from those jobs.

This PR is mostly a proof of concept for how inter-job communication
could look like, so people can provide feedback and suggestions

Closes  #15199

May close #15220 since now jobs can access their own id.

# User-Facing Changes

Adds, `job id`, `job send`, `job recv` and `job flush`  commands.

# Tests + Formatting

[X] TODO:  Implement tests
[X] Consider rewriting some of the job-related tests to use this, to
make them a bit less fragile.

# After Submitting
2025-04-26 23:24:35 +08:00
..
src Inter-Job direct messaging (#15253) 2025-04-26 23:24:35 +08:00
tests Inter-Job direct messaging (#15253) 2025-04-26 23:24:35 +08:00
Cargo.toml build(deps): bump data-encoding from 2.8.0 to 2.9.0 (#15580) 2025-04-16 22:14:36 +08:00
LICENSE Fix rest of license year ranges (#8727) 2023-04-04 09:03:29 +12:00
README.md Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00

This crate contains the majority of our commands

We allow ourselves to move some of the commands in nu-command to nu-cmd-* crates as needed.

Internal Nushell crate

This crate implements components of Nushell and is not designed to support plugin authors or other users directly.