Skip to content

Commit

Permalink
Add functionality to start and shutdown grpc client workers from ioen…
Browse files Browse the repository at this point in the history
…vironment
  • Loading branch information
Ravi Nagarjun Akella authored and Ravi Nagarjun Akella committed Feb 12, 2024
1 parent a51b7f7 commit 69c4e04
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class IOMgrConan(ConanFile):
name = "iomgr"
version = "11.1.0"
version = "11.1.1"

homepage = "https://github.com/eBay/IOManager"
description = "Asynchronous event manager"
Expand Down
1 change: 1 addition & 0 deletions src/include/iomgr/io_environment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class IOEnvironment {
IOEnvironment& with_token_verifier(std::shared_ptr< sisl::TokenVerifier >&& token_verifier);
IOEnvironment& with_token_client(std::shared_ptr< sisl::TokenClient >&& token_client);
IOEnvironment& with_object_manager();
IOEnvironment& with_grpc_client_workers(std::string const& name, uint32_t const num_workers);

std::shared_ptr< iomgr::HttpServer > get_http_server() { return m_http_server; }
std::shared_ptr< sisl::TokenVerifier > get_token_verifier() { return m_token_verifier; }
Expand Down
7 changes: 7 additions & 0 deletions src/lib/io_environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "iomgr_config.hpp"

#include <sisl/sobject/sobject.hpp>
#include <sisl/grpc/grpc_client.hpp>

namespace iomgr {

Expand All @@ -28,6 +29,7 @@ IOEnvironment::IOEnvironment() {
IOEnvironment::~IOEnvironment() {
if (m_http_server) { m_http_server->stop(); }
if (m_file_watcher) { m_file_watcher->stop(); }
sisl::GrpcAsyncClientWorker::shutdown_all();
}

void IOEnvironment::restart_http_server(std::string const& ssl_cert, std::string const& ssl_key) {
Expand Down Expand Up @@ -75,6 +77,11 @@ IOEnvironment& IOEnvironment::with_object_manager() {
return get_instance();
}

IOEnvironment& IOEnvironment::with_grpc_client_workers(std::string const& name, uint32_t const num_workers) {
sisl::GrpcAsyncClientWorker::create_worker(name, num_workers);
return get_instance();
}

std::string IOEnvironment::get_ssl_cert() const { return m_ssl_cert; }
std::string IOEnvironment::get_ssl_key() const { return m_ssl_key; }
void IOEnvironment::set_ssl_certs(std::string const& ssl_cert, std::string const& ssl_key) {
Expand Down

0 comments on commit 69c4e04

Please sign in to comment.