-
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
karm-rpc: Split off karm-rpc from karm-sys.
- Loading branch information
1 parent
2c497f7
commit 7485ecd
Showing
29 changed files
with
141 additions
and
94 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include "base.h" | ||
|
||
namespace Karm::Rpc { | ||
|
||
static Endpoint *_globalEndpoint = nullptr; | ||
|
||
Endpoint::Endpoint(Sys::IpcConnection con) | ||
: _con(std::move(con)) { | ||
_globalEndpoint = this; | ||
// FIXME: Find a way to do proper cleanup | ||
Async::detach(_receiverTask(*this), [](Res<> res) { | ||
logError("receiver task exited: {}", res); | ||
panic("receiver task exited"); | ||
}); | ||
} | ||
|
||
Endpoint Endpoint::create(Sys::Context &ctx) { | ||
auto &channel = useChannel(ctx); | ||
return {std::move(channel.con)}; | ||
} | ||
|
||
Endpoint &globalEndpoint() { | ||
if (not _globalEndpoint) | ||
panic("no active endpoint"); | ||
return *_globalEndpoint; | ||
} | ||
|
||
} // namespace Karm::Rpc |
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,9 @@ | ||
{ | ||
"$schema": "https://schemas.cute.engineering/stable/cutekit.manifest.component.v1", | ||
"id": "karm-rpc", | ||
"type": "lib", | ||
"description": "A remote procedure call library", | ||
"requires": [ | ||
"karm-sys" | ||
] | ||
} |
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
] | ||
}, | ||
"requires": [ | ||
"karm-rpc", | ||
"karm-sys" | ||
] | ||
} |
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,17 +1,22 @@ | ||
#pragma once | ||
|
||
#include <karm-base/string.h> | ||
#include <karm-sys/rpc.h> | ||
#include <karm-rpc/base.h> | ||
|
||
namespace Grund::Bus { | ||
namespace Grund::Bus::Api { | ||
|
||
struct Locate { | ||
using Response = Sys::Port; | ||
using Response = Rpc::Port; | ||
String id; | ||
}; | ||
|
||
struct Listen { | ||
Meta::Id mid; | ||
}; | ||
|
||
} // namespace Grund::Bus | ||
struct Start { | ||
// FIXME: Handle intent instead of simple id? | ||
String id; | ||
}; | ||
|
||
} // namespace Grund::Bus::Api |
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
] | ||
}, | ||
"requires": [ | ||
"karm-rpc", | ||
"karm-sys" | ||
] | ||
} |
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
] | ||
}, | ||
"requires": [ | ||
"karm-rpc", | ||
"karm-sys" | ||
] | ||
} |
Oops, something went wrong.