Skip to content

client-daemon communication via gRPC#62

Draft
Sophon96 wants to merge 8 commits into
mainfrom
tonic
Draft

client-daemon communication via gRPC#62
Sophon96 wants to merge 8 commits into
mainfrom
tonic

Conversation

@Sophon96

@Sophon96 Sophon96 commented Nov 11, 2022

Copy link
Copy Markdown
Member

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

Signed-off-by: Sophon96 <71684640+Sophon96@users.noreply.github.com>
@Sophon96 Sophon96 self-assigned this Nov 11, 2022

@JakeRoggenbuck JakeRoggenbuck left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

This looks great!

Comment thread daemon/src/main.rs
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
Copy Markdown
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
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • working

@Sophon96 Sophon96 Nov 12, 2022

Copy link
Copy Markdown
Member Author

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

Sophon96 commented Nov 11, 2022

Copy link
Copy Markdown
Member Author

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

@JakeRoggenbuck

Copy link
Copy Markdown
Member

Cool cool, great work!

@Sophon96 Sophon96 added enhancement New feature or request client daemon labels Nov 11, 2022
…am in daemon

Signed-off-by: Sophon96 <71684640+Sophon96@users.noreply.github.com>
Signed-off-by: Sophon96 <71684640+Sophon96@users.noreply.github.com>
Signed-off-by: Sophon96 <71684640+Sophon96@users.noreply.github.com>
Signed-off-by: Sophon96 <71684640+Sophon96@users.noreply.github.com>
@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