This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 2025/10/08 09:57:58 Received {c0 n0 {"type":"init","node_id":"n0","node_ids":["n0"],"msg_id":1}} | |
| 2025/10/08 09:57:58 Node n0 initialized | |
| 2025/10/08 09:57:58 Sent {"src":"n0","dest":"c0","body":{"in_reply_to":1,"type":"init_ok"}} | |
| 2025/10/08 09:57:58 Received {c2 n0 {"echo":"Please echo 66","type":"echo","msg_id":1}} | |
| 2025/10/08 09:57:58 Sent {"src":"n0","dest":"c2","body":{"echo":"Please echo 66","in_reply_to":1,"msg_id":1,"type":"echo_ok"}} | |
| 2025/10/08 09:57:58 Received {c2 n0 {"echo":"Please echo 9","type":"echo","msg_id":2}} | |
| 2025/10/08 09:57:58 Sent {"src":"n0","dest":"c2","body":{"echo":"Please echo 9","in_reply_to":2,"msg_id":2,"type":"echo_ok"}} | |
| 2025/10/08 09:57:58 Received {c2 n0 {"echo":"Please echo 34","type":"echo","msg_id":3}} | |
| 2025/10/08 09:57:58 Sent {"src":"n0","dest":"c2","body":{"echo":"Please echo 34","in_reply_to":3,"msg_id":3,"type":"echo_ok"}} | |
| 2025/10/08 09:57:58 Received {c2 n0 {"echo":"Please echo 113","type":"echo","msg_id":4}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package example | |
| import fs2._ | |
| object TransformingStreams extends App { | |
| def tkWhile[F[_], O](p: O => Boolean): Pipe[F, O, O] = { | |
| def go(s: Stream[F, O]): Pull[F, O, Unit] = | |
| s.pull.uncons.flatMap { | |
| case Some((hd, tl)) => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package example | |
| import fs2._ | |
| object TransformingStreams extends App { | |
| def tkWhile[F[_], O](p: O => Boolean): Pipe[F, O, O] = { | |
| def go(s: Stream[F, O]): Pull[F, O, Unit] = | |
| s.pull.uncons.flatMap { | |
| case Some((hd, tl)) => |