Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add delimiter option #35

Open
wybiral opened this issue Apr 26, 2020 · 0 comments
Open

Add delimiter option #35

wybiral opened this issue Apr 26, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@wybiral
Copy link
Owner

wybiral commented Apr 26, 2020

It would be useful to be able to align writes based on a delimiter character, especially for reading text protocols like stdin, file, tcp, serial, etc.

For example hookah -d "\n" -i serial:///dev/ttyACM0 -o ws://localhost:8080 would read each line from the serial device and send them to the WebSocket connection (not including the newline delimiter).

This is an incredibly common piping task and would make things like newline-delimited JSON streams easier to work with.

The only downside is that messages larger than the buffer will still have to be split (to avoid memory issues) so stripping the delimiter would make it impossible to determine boundaries for those messages. But in that case you may just need a bigger buffer.

@wybiral wybiral added the enhancement New feature or request label Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant