bend-pipe-session Releases (2): 0.2.0.0 0x5c7c6b74577e42dff11295308f4f8e90 indexed https://jend.leeeet.dev/files.txt?path=bend-pipe-session@0.2.0.0 0.1.0.0 0xd529d46f09a2ffa96a7a9e5754713137 unindexed https://jend.leeeet.dev/files.txt?path=bend-pipe-session@0.1.0.0 Definitions (18): Impl.PipeSession (https://jend.leeeet.dev/definition.txt?path=bend-pipe-session@0.2.0.0/impl.bend&name=PipeSession) # A running program: its process id, the File that writes its stdin, the File that reads its stdout, # and the most bytes in one of its lines, with its line end. type PipeSession is Type: PipeSession{pid: U32, input: File, out: File, line_cap: U32} Impl.Heard (https://jend.leeeet.dev/definition.txt?path=bend-pipe-session@0.2.0.0/impl.bend&name=Heard) # A line of the program, as PipeSession.ask sorts it. type Heard is Type: Line{text: String} Last{text: String} Ended{} Failed{error: U32 & String} Impl.PipeSession.pid (https://jend.leeeet.dev/definition.txt?path=bend-pipe-session@0.2.0.0/impl.bend&name=PipeSession.pid) def PipeSession.pid(session: PipeSession) -> PipeSession & U32: Impl.PipeSession.started (https://jend.leeeet.dev/definition.txt?path=bend-pipe-session@0.2.0.0/impl.bend&name=PipeSession.started) def PipeSession.started( opened: Result<&1, &1, U32 & String, U32 & (File & File)>, line_cap: U32 ) -> Result<&1, &1, U32 & String, PipeSession>: Impl.PipeSession.start (https://jend.leeeet.dev/definition.txt?path=bend-pipe-session@0.2.0.0/impl.bend&name=PipeSession.start) # Starts program with args. A longer line of it fails with E2BIG (7). def PipeSession.start( program: String, args: List, line_cap: U32 ) -> IO(Result<&1, &1, U32 & String, PipeSession>): Impl.PipeSession.ended (https://jend.leeeet.dev/definition.txt?path=bend-pipe-session@0.2.0.0/impl.bend&name=PipeSession.ended) # The code of the error that PipeSession.ask gives when the program ended before its answer: # EPIPE. def PipeSession.ended() -> U32: Impl.Heard.read (https://jend.leeeet.dev/definition.txt?path=bend-pipe-session@0.2.0.0/impl.bend&name=Heard.read) def Heard.read( read: File & Result<&1, &1, U32 & String, Maybe>, +until: String ) -> File & Heard: Impl.PipeSession.ask.go (https://jend.leeeet.dev/definition.txt?path=bend-pipe-session@0.2.0.0/impl.bend&name=PipeSession.ask.go) # said holds the lines so far, the last first; fuel bounds the lines, far beyond any answer. def PipeSession.ask.go( fuel: Nat, at: File & Heard, +until: String, +line_cap: U32, said: List<&2, String> ) -> IO(File & Result<&1, &1, U32 & String, List<&2, String>>): Impl.PipeSession.asked (https://jend.leeeet.dev/definition.txt?path=bend-pipe-session@0.2.0.0/impl.bend&name=PipeSession.asked) def PipeSession.asked( pid: U32, input: File, line_cap: U32, answer: File & Result<&1, &1, U32 & String, List<&2, String>> ) -> IO(PipeSession & Result<&1, &1, U32 & String, List<&2, String>>): Impl.PipeSession.wrote (https://jend.leeeet.dev/definition.txt?path=bend-pipe-session@0.2.0.0/impl.bend&name=PipeSession.wrote) def PipeSession.wrote( pid: U32, wrote: File & Result<&1, &1, U32 & String, Unit>, out: File, +line_cap: U32, +until: String ) -> IO(PipeSession & Result<&1, &1, U32 & String, List<&2, String>>): Impl.PipeSession.ask (https://jend.leeeet.dev/definition.txt?path=bend-pipe-session@0.2.0.0/impl.bend&name=PipeSession.ask) # Sends lines, then answers the program's lines up to the first that starts with until. def PipeSession.ask( session: PipeSession, lines: List, +until: String ) -> IO(PipeSession & Result<&1, &1, U32 & String, List<&2, String>>): Impl.PipeSession.kill (https://jend.leeeet.dev/definition.txt?path=bend-pipe-session@0.2.0.0/impl.bend&name=PipeSession.kill) # Kills the program, whether or not it has ended, and closes its Files. def PipeSession.kill(session: PipeSession) -> IO(Unit): Impl.PipeSession.Answer (https://jend.leeeet.dev/definition.txt?path=bend-pipe-session@0.2.0.0/impl.bend&name=PipeSession.Answer) # What PipeSession.ask gives. def PipeSession.Answer() -> Type: Impl.PipeSession.ask.late (https://jend.leeeet.dev/definition.txt?path=bend-pipe-session@0.2.0.0/impl.bend&name=PipeSession.ask.late) # The answer that came once the program was killed: its Files close. def PipeSession.ask.late(late: Maybe<&1, PipeSession.Answer()>) -> IO(Maybe): Impl.PipeSession.ask.polled (https://jend.leeeet.dev/definition.txt?path=bend-pipe-session@0.2.0.0/impl.bend&name=PipeSession.ask.polled) def PipeSession.ask.polled( +pid: U32, +chan: Chan(PipeSession.Answer()), polled: Poll<&1, &1, Maybe<&1, PipeSession.Answer()>, Unit> ) -> IO(Maybe): Impl.PipeSession.ask.within (https://jend.leeeet.dev/definition.txt?path=bend-pipe-session@0.2.0.0/impl.bend&name=PipeSession.ask.within) # As PipeSession.ask, within ms; None when the program has not answered by then: it is killed, and # the session is gone. Nothing of it runs on after. def PipeSession.ask.within( session: PipeSession, lines: List, +until: String, ms: U32 ) -> IO(Maybe): Impl.PipeSession.end.go (https://jend.leeeet.dev/definition.txt?path=bend-pipe-session@0.2.0.0/impl.bend&name=PipeSession.end.go) def PipeSession.end.go( fuel: Nat, read: File & Result<&1, &1, U32 & String, Maybe>, +line_cap: U32, said: List<&2, String> ) -> IO(Result<&1, &1, U32 & String, List<&2, String>>): Impl.PipeSession.end (https://jend.leeeet.dev/definition.txt?path=bend-pipe-session@0.2.0.0/impl.bend&name=PipeSession.end) # Closes the program's stdin, then answers what it said until it ended. def PipeSession.end(session: PipeSession) -> IO(Result<&1, &1, U32 & String, List<&2, String>>):