vimalloc / weechat-alert Goto Github PK
View Code? Open in Web Editor NEWWeechat relay to make sound alerts when used behind tmux
License: MIT License
Weechat relay to make sound alerts when used behind tmux
License: MIT License
I have a feeling I'm doing a lot of pass by values and copying strings around using String::from() all over the place, that could be better handled by passing string references around. Need to look into this more
Can reproduce with "/query <non_opened_buffer> Hey"
thread '<main>' panicked at 'arithmetic operation overflowed', src/parse.rs:239
AL lib: (EE) alc_cleanup: 1 device not closed
error: Process didn't exit successfully: `target/debug/weechat_alert` (exit code: 101)
Make the relay portion of this a library, where you can register callback handlers for incoming data. This is totally unnecessary for the app I'm building, but I think it would have a few benefits for learning rust, namely
Everything that can go wrong should return a weechat error instead of panicing.
We need to be able to send and receive data on the socket concurrently (or similar to that with a non-blocking or asynchronous approach). This is so that we can send pings every so often to check the state of the socket, and so that other people using this as a library could send commands without having to wait for a recv call to happen first (ex, sending a message to a buffer).
Originally, I was planning to simply use try_clone on the socket, and setup 1 thread for receiving and 1 thread for sending. However, apparently this doesn't working ok SSL sockets (see sfackler/rust-openssl#338 and http://stackoverflow.com/questions/14467630). With that out of the question, I think using a non-blocking socket to do both the sends and receives is probably the best way to go.
Random comment on reddit, it looks like "if let" may help clean up some of the match/panic code I have everywhere. Look at this
Forgot to implement this on the first go around
Ping/pong every so often to make sure the connection is still alive
I think I should re-arange this stuff. My initial thought is have a generic Message class. It implements message header, message body, etc. It also reads from a socket to build these things. Maybe. But that also sounds smelly. Hrm
MessageData to MessageBody
DataType to HDataType
etc
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.