Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
  • Categories

    • Bits
    • Bytes
    • Chart
    • Conversions
    • Core
    • Database
    • Dataframe
    • Dataframe Or Lazyframe
    • Date
    • Debug
    • Default
    • Env
    • Experimental
    • Expression
    • Filesystem
    • Filters
    • Formats
    • Generators
    • Hash
    • History
    • Lazyframe
    • Math
    • Misc
    • Network
    • Path
    • Platform
    • Plugin
    • Prompt
    • Random
    • Removed
    • Shells
    • Strings
    • System
    • Viewers

job recv for experimental

Read a message from the mailbox.

Signature

> job recv {flags}

Flags

  • --tag {int}: A tag for the message
  • --timeout {duration}: The maximum time duration to wait for.

Input/output types:

inputoutput
nothingany

Examples

Block the current thread while no message arrives

> job recv

Receive a message, wait for at most 10 seconds.

> job recv --timeout 10sec

Get a message or fail if no message is available immediately

> job recv --timeout 0sec

Notes

When messages are sent to the current process, they get stored in what is called the "mailbox". This commands reads and returns a message from the mailbox, in a first-in-first-out fashion. j Messages may have numeric flags attached to them. This commands supports filtering out messages that do not satisfy a given tag, by using the tag flag. If no tag is specified, this command will accept any message.

If no message with the specified tag (if any) is available in the mailbox, this command will block the current thread until one arrives. By default this command block indefinitely until a matching message arrives, but a timeout duration can be specified. If a timeout duration of zero is specified, it will succeed only if there already is a message in the mailbox.

Note: When using par-each, only one thread at a time can utilize this command. In the case of two or more threads running this command, they will wait until other threads are done using it, in no particular order, regardless of the specified timeout parameter.