bond_target(3)

πŸ“¦
version 0.7.1 Β· 2 versions
, in nixos 26.05

πŸ’… bond_target(3) πŸ’…

okay bestie, this one is from the Library Functions Manual and it's giving β€œplumbing but make it lore” πŸ’–. It's the bond_target page, and we're gonna get you from zero to β€œohhh that's what that pipe does” without losing a single arg, flag, or vibe. periodt.


🌸 NAME 🌸

  • bond_target β€” Setup a state transfer pipe between two targets. 🫢

✨ SYNOPSIS ✨

not me presenting the synopsis exactly as written, lone nil and all, because we do not editorialize the API 😭:

nil
bond_target( vid:source, vid:dest )
bond_target( vid:source, vid:dest, bool:blob )
bond_target( vid:source, vid:dest, bool:blob, string:identifier )
bond_target( vid:source, vid:dest, bool:blob, string:id_source,
string:id_dest )

πŸ’– DESCRIPTION πŸ’–

okay so this function is used to setup a state transfer stream between two targets. The way it works is a pipe-pair gets created: the write-end is sent to source, and the read-end is sent to dest. icon behavior, honestly. πŸŽ€

By default, the transfer target type is marked as 'state', which means dest should replace its runtime state with that of source. highkey the whole point. ✨

If the blob argument is set to true, then the transfer type becomes that of an opaque data blob, and it's up to dest to figure out what to do with it. no extra instructions, just vibes and bytes πŸ’€.

The identifier is a short string matching a previously announced extension or one of the reserved stdin, stdout or stderr names. If a single identifier is sent, it gets used for both source and dest. Otherwise, id_source is sent to source and id_dest is sent to dest. iykyk. 🌈


πŸŽ€ EXAMPLE πŸŽ€

here's the exact example, bestie β€” bond_target0() doing its little two-feed pipeline moment πŸ‘‘

function bond_target0()
      local feed_1 =
      launch_avfeed("keep_alive:exec=ls /", "terminal",
            function(source, status)
            end
      )
      local feed_2 =
      launch_avfeed("keep_alive:exec=tee", "terminal",
            function(source, status)
            end
      )
      bond_target(feed_1, feed_2, true, "stdout", "stdin")
      local in = open_nonblock(feed_2, false)
end

the way it spins up feed_1 with "keep_alive:exec=ls /", spins up feed_2 with "keep_alive:exec=tee", bonds them with bond_target(feed_1, feed_2, true, "stdout", "stdin"), then grabs local in = open_nonblock(feed_2, false)? obsessed. πŸ¦‹


πŸ‘€ SEE ALSO πŸ‘€

  • Arcan Lua API β€” that's the see-also squad, and it's carrying the whole section πŸ’œ.

πŸ’– that's the whole page, bestie: source/version Arcan Lua API, date October 2026, and the manual page is bond_target(3). slay, go bond some targets πŸŽ€βœ¨

πŸ“¦ where this page comes from