Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [14.5.0] - 2026-06-04
- Add deregister_generic_rpc()

## [14.5.0] - 2026-06-03
- Shared awaitable

Expand Down
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class SISLConan(ConanFile):
name = "sisl"
version = "14.5.0"
version = "14.6.0"

homepage = "https://github.com/eBay/sisl"
description = "Library for fast data structures, utilities"
Expand Down
5 changes: 5 additions & 0 deletions include/sisl/grpc/rpc_server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ class GrpcServer : private boost::noncopyable {
void run_generic_completion_cb(const std::string& rpc_name, boost::intrusive_ptr< GenericRpcData >& rpc_data);
bool register_async_generic_service();
bool register_generic_rpc(const std::string& name, const generic_rpc_handler_cb_t& rpc_handler);
// Remove a previously registered generic RPC handler so the server stops dispatching it (returns true if an
// entry was removed). New calls for `name` get UNIMPLEMENTED via run_generic_handler_cb; this does NOT drain a
// handler already executing (run_generic_handler_cb releases the registry lock before invoking the cb), so the
// caller must ensure no in-flight handler outlives any state the cb captures.
bool deregister_generic_rpc(const std::string& name);

private:
void handle_rpcs(uint32_t thread_num, const rpc_thread_start_cb_t& thread_start_cb);
Expand Down
8 changes: 8 additions & 0 deletions src/grpc/rpc_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,14 @@ bool GrpcServer::register_generic_rpc(const std::string& name, const generic_rpc
return true;
}

bool GrpcServer::deregister_generic_rpc(const std::string& name) {
// Drop the handler from the dispatch registry; subsequent run_generic_handler_cb lookups for `name` miss and
// return UNIMPLEMENTED. The per-cq GenericRpcData accept slots are generic (not per-method), so they are left
// in place to keep serving the remaining registered methods.
std::unique_lock< std::shared_mutex > lock(m_generic_rpc_registry_mtx);
return m_generic_rpc_registry.erase(name) > 0;
}

// RPCHelper static methods

bool RPCHelper::has_server_shutdown(const GrpcServer* server) {
Expand Down
Loading