Clean up socket.rs #40

Open
opened 2026-07-05 04:32:04 +00:00 by javif89 · 0 comments
Owner

With the addition of the application container and AppMessage in #38, the SocketCommand is now unused. We should also figure out if we still want WaycastSocketListener or if we just want to make the listener a method in the app container.

We can also just serialize the AppMessage with serde and send it over the wire so we don't have to maintain the string table we currently have:

// client
self.client.write_all(serde_json::to_string(&cmd)?.as_bytes())?;
self.client.write_all(b"\n")?;
// listener
let cmd: AppMessage = serde_json::from_str(msg.trim())?;
command_tx.send(cmd)?;
With the addition of the application container and `AppMessage` in #38, the `SocketCommand` is now unused. We should also figure out if we still want `WaycastSocketListener` or if we just want to make the listener a method in the app container. We can also just serialize the AppMessage with serde and send it over the wire so we don't have to maintain the string table we currently have: ```rust // client self.client.write_all(serde_json::to_string(&cmd)?.as_bytes())?; self.client.write_all(b"\n")?; // listener let cmd: AppMessage = serde_json::from_str(msg.trim())?; command_tx.send(cmd)?; ```
javif89 added this to the (deleted) milestone 2026-07-06 17:48:50 +00:00
javif89 added this to the Code cleanup project 2026-07-08 00:21:30 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
waycasthq/waycast#40
No description provided.