Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,9 @@ extension Target {
.protobuf,
.testing,
],
resources: [
.copy("Configuration/Inputs")
],
swiftSettings: [.swiftLanguageMode(.v6), .enableUpcomingFeature("ExistentialAny")]
)
}
Expand Down
1 change: 1 addition & 0 deletions Sources/GRPCCore/Configuration/MethodConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ extension MethodConfig: Codable {
public func encode(to encoder: any Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(self.names, forKey: .name)
try container.encodeIfPresent(self.waitForReady, forKey: .waitForReady)
try container.encodeIfPresent(
self.timeout.map { GoogleProtobufDuration(duration: $0) },
forKey: .timeout
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"maxAttempts": 1,
"hedgingDelay": "1s",
"nonFatalStatusCodes": ["ABORTED"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"maxAttempts": 3,
"hedgingDelay": "1s",
"nonFatalStatusCodes": ["ABORTED"]
}
12 changes: 12 additions & 0 deletions Tests/GRPCCoreTests/Configuration/Inputs/method_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": [
{
"service": "echo.Echo",
"method": "Get"
}
],
"waitForReady": true,
"timeout": "1s",
"maxRequestMessageBytes": 1024,
"maxResponseMessageBytes": 2048
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"service": "foo.bar",
"method": "baz"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"service": "foo.bar"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"maxAttempts": 3,
"initialBackoff": "1s",
"maxBackoff": "3s",
"backoffMultiplier": -1.6,
"retryableStatusCodes": ["ABORTED", "UNAVAILABLE"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"maxAttempts": 3,
"initialBackoff": "0s",
"maxBackoff": "3s",
"backoffMultiplier": 1.6,
"retryableStatusCodes": ["ABORTED", "UNAVAILABLE"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"maxAttempts": 1,
"initialBackoff": "1s",
"maxBackoff": "3s",
"backoffMultiplier": 1.6,
"retryableStatusCodes": ["ABORTED", "UNAVAILABLE"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"maxAttempts": 3,
"initialBackoff": "1s",
"maxBackoff": "0s",
"backoffMultiplier": 1.6,
"retryableStatusCodes": ["ABORTED", "UNAVAILABLE"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"maxAttempts": 3,
"initialBackoff": "1s",
"maxBackoff": "3s",
"backoffMultiplier": 1.6,
"retryableStatusCodes": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"maxAttempts": 3,
"initialBackoff": "1s",
"maxBackoff": "3s",
"backoffMultiplier": 1.6,
"retryableStatusCodes": ["ABORTED", "UNAVAILABLE"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": [
{
"service": "echo.Echo",
"method": "Get"
}
],
"waitForReady": true,
"timeout": "1s",
"maxRequestMessageBytes": 1024,
"maxResponseMessageBytes": 2048,
"hedgingPolicy": {
"maxAttempts": 3,
"hedgingDelay": "42s",
"nonFatalStatusCodes": [
"ABORTED",
"UNIMPLEMENTED"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": [
{
"service": "echo.Echo",
"method": "Get"
}
],
"waitForReady": true,
"timeout": "1s",
"maxRequestMessageBytes": 1024,
"maxResponseMessageBytes": 2048,
"retryPolicy": {
"maxAttempts": 3,
"initialBackoff": "1s",
"maxBackoff": "3s",
"backoffMultiplier": 1.6,
"retryableStatusCodes": [
"ABORTED",
"UNIMPLEMENTED"
]
}
}
Loading
Loading