mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2026-01-06 17:23:00 -08:00
tokio is needed by both temporal & gcloud pubsub, so make just one instance for the whole library, add init/shutdown functions for it exposed to C
This commit is contained in:
parent
4b3b847c7f
commit
837f15d01b
5 changed files with 65 additions and 16 deletions
|
|
@ -67,6 +67,8 @@ CV1::CV1(const Identity& myId, const char* path, int listenPort, RedisConfig* rc
|
|||
auto span = tracer->StartSpan("cv1::CV1");
|
||||
auto scope = tracer->WithActiveSpan(span);
|
||||
|
||||
rustybits::init_async_runtime();
|
||||
|
||||
char myAddress[64];
|
||||
_myAddressStr = myId.address().toString(myAddress);
|
||||
_connString = std::string(path);
|
||||
|
|
@ -157,6 +159,8 @@ CV1::~CV1()
|
|||
_smee = NULL;
|
||||
}
|
||||
|
||||
rustybits::shutdown_async_runtime();
|
||||
|
||||
_run = 0;
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue