-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Qing Wang <kingchin1218@gmail.com>
- Loading branch information
1 parent
270546d
commit f75c812
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
|
||
|
||
"""This module should be cached locally due to all configurations | ||
are mutable. | ||
""" | ||
|
||
import fed._private.compatible_utils as compatible_utils | ||
import fed._private.constants as fed_constants | ||
import cloudpickle | ||
import json | ||
|
||
from typing import Dict, List, Optional | ||
from dataclasses import dataclass | ||
|
||
|
||
@dataclass | ||
class GrpcCrossSiloMessageConfig: | ||
"""A class to store parameters used for GRPC communication | ||
Attributes: | ||
grpc_retry_policy: a dict descibes the retry policy for | ||
cross silo rpc call. If None, the following default retry policy | ||
will be used. More details please refer to | ||
`retry-policy <https://github.com/grpc/proposal/blob/master/A6-client-retries.md#retry-policy>`_. # noqa | ||
.. code:: python | ||
{ | ||
"maxAttempts": 4, | ||
"initialBackoff": "0.1s", | ||
"maxBackoff": "1s", | ||
"backoffMultiplier": 2, | ||
"retryableStatusCodes": [ | ||
"UNAVAILABLE" | ||
] | ||
} | ||
grpc_channel_options: A list of tuples to store GRPC channel options, | ||
e.g. [ | ||
('grpc.enable_retries', 1), | ||
('grpc.max_send_message_length', 50 * 1024 * 1024) | ||
] | ||
""" | ||
grpc_channel_options: List = None | ||
grpc_retry_policy: Dict[str, str] = None |