-
Notifications
You must be signed in to change notification settings - Fork 860
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make communications pluggable in C++ SDK (#2763)
- Loading branch information
1 parent
3af7199
commit 58c47b5
Showing
33 changed files
with
12,110 additions
and
5,872 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
build/ | ||
.clangd | ||
*.bak |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#ifndef COMMUNICATOR_H | ||
#define COMMUNICATOR_H | ||
|
||
#include "flwr/proto/fleet.pb.h" | ||
#include <chrono> | ||
#include <optional> | ||
|
||
class Communicator { | ||
public: | ||
virtual bool send_create_node(flwr::proto::CreateNodeRequest request, | ||
flwr::proto::CreateNodeResponse *response) = 0; | ||
|
||
virtual bool send_delete_node(flwr::proto::DeleteNodeRequest request, | ||
flwr::proto::DeleteNodeResponse *response) = 0; | ||
|
||
virtual bool | ||
send_pull_task_ins(flwr::proto::PullTaskInsRequest request, | ||
flwr::proto::PullTaskInsResponse *response) = 0; | ||
|
||
virtual bool | ||
send_push_task_res(flwr::proto::PushTaskResRequest request, | ||
flwr::proto::PushTaskResResponse *response) = 0; | ||
}; | ||
|
||
void create_node(Communicator *communicator); | ||
void delete_node(Communicator *communicator); | ||
void send(Communicator *communicator, flwr::proto::TaskRes task_res); | ||
std::optional<flwr::proto::TaskIns> receive(Communicator *communicator); | ||
|
||
#endif |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.