def PipeSession.ask

bend-pipe-session@0.2.0.0 · impl.bend:131

import bend-pipe-session@0.2.0.0/impl.bend as Impl
import Base
import bend-stdio-pipes@0.2.0.0/impl.bend as Stdio

131# Sends lines, then answers the program's lines up to the first that starts with until.
132def PipeSession.ask(
133  session: PipeSession,
134  lines: List<String>,
135  +until: String
136) -> IO(PipeSession & Result<&1, &1, U32 & String, List<&2, String>>):
137  match session:
138    case PipeSession{pid, input, out, line_cap}:
139      do IO<PipeSession & Result<&1, &1, U32 & String, List<&2, String>>>:
140        wrote: File & Result<&1, &1, U32 & String, Unit> <- Stdio.write_lines(input, lines)
141        PipeSession.wrote(pid, wrote, out, line_cap, until)

Uses (12)

Used by (1)