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

client-daemon communication via gRPC #62

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

client-daemon communication via gRPC #62

wants to merge 8 commits into from

Conversation

Sophon96
Copy link
Member

@Sophon96 Sophon96 commented Nov 11, 2022

This PR only aims to implement communication between the client and the daemon.

Proto

  • Implement all RPC methods
    • Get chat history
    • Subscribe to events
    • Send message
    • Edit message
    • Delete message
    • Everything else
  • Message structures
    • Chat history request/response
    • Event subscription request/response
    • Send/edit/delete message request/response
    • actual message message (the one that describes a chat message)
      • user
      • id
      • timestamp
      • content

Daemon

  • gRPC Server (probably going to have to wait until database)
    • Implement all RPC methods on server side
      • Get chat history
      • Subscribe to events
        • Will likely need to wait for daemon-to-daemon communication
      • Send message
      • Edit message
      • Delete message
    • TESTS TESTS TESTS

Client

  • gRPC client
    • Will likely need to wait for the frontend to finish but
    • Implement all RPC methods on server side
      • Get chat history
      • Subscribe to events on startup
        • probably the only one that can be done w/o frontend
      • Send message
      • Edit message
      • Delete message
    • Tests

@Sophon96 Sophon96 self-assigned this Nov 11, 2022
Copy link
Member

@JakeRoggenbuck JakeRoggenbuck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ayo! thanks!

@JakeRoggenbuck
Copy link
Member

This looks great!

let addr = "0.0.0.0:5768".parse()?;
let cd_svc = client_server::ClientDaemonService {};
let cd_srv = ClientDaemonServer::new(cd_svc);
println!("Client gRPC server on {}", addr);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you implement the connection here, is it work?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • working

Copy link
Member Author

@Sophon96 Sophon96 Nov 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! If you run it, you can use a gRPC client like BloomRPC and import proto/client_daemon.proto and fire off RPC calls, though all of them are just blank for now.

@Sophon96
Copy link
Member Author

Sophon96 commented Nov 11, 2022

That was fast! Let me draft out a few tasks that need to be done before this can be merged...

@JakeRoggenbuck
Copy link
Member

Cool cool, great work!

@Sophon96 Sophon96 added enhancement New feature or request client daemon labels Nov 11, 2022
@Sophon96 Sophon96 marked this pull request as ready for review November 19, 2022 06:29
@Sophon96 Sophon96 marked this pull request as draft November 20, 2022 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client daemon enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants