Skip to content

Commit

Permalink
reset to main
Browse files Browse the repository at this point in the history
  • Loading branch information
panh99 committed Oct 30, 2024
1 parent 63e1759 commit 1d412ad
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@

from flwr.common import log
from flwr.common.constant import (
GRPC_ADAPTER_METADATA_FLOWER_PACKAGE_NAME_KEY,
GRPC_ADAPTER_METADATA_FLOWER_PACKAGE_VERSION_KEY,
GRPC_ADAPTER_METADATA_FLOWER_VERSION_KEY,
GRPC_ADAPTER_METADATA_MESSAGE_MODULE_KEY,
GRPC_ADAPTER_METADATA_MESSAGE_QUALNAME_KEY,
GRPC_ADAPTER_METADATA_SHOULD_EXIT_KEY,
)
from flwr.common.grpc import create_channel, on_channel_state_change
from flwr.common.version import package_version
from flwr.common.version import package_name, package_version
from flwr.proto.fab_pb2 import GetFabRequest, GetFabResponse # pylint: disable=E0611
from flwr.proto.fleet_pb2 import ( # pylint: disable=E0611
CreateNodeRequest,
Expand Down Expand Up @@ -100,9 +104,16 @@ def _send_and_receive(
self, request: GrpcMessage, response_type: type[T], **kwargs: Any
) -> T:
# Serialize request
req_cls = request.__class__
container_req = MessageContainer(
metadata={GRPC_ADAPTER_METADATA_FLOWER_VERSION_KEY: package_version},
grpc_message_name=request.__class__.__qualname__,
metadata={
GRPC_ADAPTER_METADATA_FLOWER_PACKAGE_NAME_KEY: package_name,
GRPC_ADAPTER_METADATA_FLOWER_PACKAGE_VERSION_KEY: package_version,
GRPC_ADAPTER_METADATA_FLOWER_VERSION_KEY: package_version,
GRPC_ADAPTER_METADATA_MESSAGE_MODULE_KEY: req_cls.__module__,
GRPC_ADAPTER_METADATA_MESSAGE_QUALNAME_KEY: req_cls.__qualname__,
},
grpc_message_name=req_cls.__qualname__,
grpc_message_content=request.SerializeToString(),
)

Expand Down

0 comments on commit 1d412ad

Please sign in to comment.