What is Nostr?
blinry /
npub1xh9…azuf
2025-02-15 11:24:12
in reply to nevent1q…c3z2

blinry on Nostr: I'm happy with this interface as long as there's only bytestream-based connections. ...

I'm happy with this interface as long as there's only bytestream-based connections.

My question now is: How could you extend this to support multiple types of connections? For example, I might want to add a connection that sends file system events, and receives file actions.

You'd probably add a "type" parameter to the connect function, so that the daemon knows what kind of connection this is. You could then serialize/deserialize the events, to use the same input/output interface.
Author Public Key
npub1xh9fh6cs7c5zhhz330pz4s5kdwg44aq7xu33f6ylxtedkjj6g6ysvuazuf