mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 08:18:15 +03:00
Allow list of services in metadata
Summary: I'm changing the semantics of `metadata.thrift` here slightly. --- Before: - `ThriftServiceContext` contains `ThriftService` inline. - `ThriftMetadata` only contains other services *referred* to by the primary service (in `ThriftServiceContext`). This includes all base classes **but not the service itself**. - Understanding the service class hierarchy requires traversing through each `parent` field and looking up the name in `ThriftMetadata`. --- After: - `ThriftServiceContextRef` contains just the service name. - `ThriftMetadata` now includes the service itself (previously inlined in `ThriftServiceContext`). - `services` field lists all names of services in the class hierarchy in order from most to least derived. **These semantics are needed to support `MultiplexAsyncProcessorFactory` where the concept of a single `parent` falls apart**. --- After migrating all clients, we can remove `ThriftServiceContext` completely. It's now deprecated. For `py3`, I've removed `extractMetadataFromServiceContext` because it's no longer needed. All it was doing was adding the inline `ThriftServiceContext` into the metadata's map... which we do by default now. Reviewed By: yfeldblum Differential Revision: D29952004 fbshipit-source-id: 13c62aafabbfc287ad64489c02104dd977be71ce
This commit is contained in:
parent
9972bda5dd
commit
54762c1866
@ -26,15 +26,11 @@ namespace scm {
|
||||
namespace service {
|
||||
|
||||
rust::srserver::RustThriftMetadata* create_metadata() noexcept {
|
||||
using apache::thrift::can_throw;
|
||||
|
||||
auto meta = new rust::srserver::RustThriftMetadata();
|
||||
meta->meta_ =
|
||||
[](apache::thrift::metadata::ThriftServiceMetadataResponse& response) {
|
||||
::apache::thrift::detail::md::ServiceMetadata<
|
||||
::facebook::scm::service::SourceControlServiceSvIf>::
|
||||
gen(can_throw(*response.metadata_ref()),
|
||||
can_throw(*response.context_ref()));
|
||||
::facebook::scm::service::SourceControlServiceSvIf>::gen(response);
|
||||
};
|
||||
return meta;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user