Skip to content

feat: Add Status constructors#137

Merged
LucioFranco merged 4 commits intohyperium:masterfrom
alce:status-revamp
Nov 15, 2019
Merged

feat: Add Status constructors#137
LucioFranco merged 4 commits intohyperium:masterfrom
alce:status-revamp

Conversation

@alce
Copy link
Contributor

@alce alce commented Nov 13, 2019

This patch adds shortcut constructors for all Status codes as well as documentation for all Code variants.

From<tokio::timer::timeout::Elapsed> for Status is also implemented, which is useful for the in-progress revamp of request timeouts.

Edit: the From<Elapsed> for Status does not compile when the transport feature is disabled. Without it, there is no tokio available. I removed the implementation for now.

alce added 2 commits November 12, 2019 18:48
Add convenience constructors for all Status codes and document all
Code variants.

Implement From tokio::timer::timeout::Elapsed for Status
@alce alce changed the title feat(tonic): Add Status constructors and From Elapsed impl feat(tonic): Add Status constructors Nov 13, 2019
const GRPC_STATUS_MESSAGE_HEADER: &str = "grpc-message";
const GRPC_STATUS_DETAILS_HEADER: &str = "grpc-status-details-bin";

// Standard status codes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this comment?

Copy link
Member

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fantastic!! Few comments but otherwise I think this is ready!

@LucioFranco
Copy link
Member

@alce I think not having the elasped one is fine for now.

alce and others added 2 commits November 14, 2019 17:46
Co-Authored-By: Lucio Franco <luciofranco14@gmail.com>
@LucioFranco LucioFranco changed the title feat(tonic): Add Status constructors feat: Add Status constructors Nov 15, 2019
@LucioFranco LucioFranco merged commit 997241c into hyperium:master Nov 15, 2019
@alce alce deleted the status-revamp branch November 15, 2019 14:20
rabbitinspace pushed a commit to satelit-project/tonic that referenced this pull request Jan 1, 2020
Co-Authored-By: Lucio Franco <luciofranco14@gmail.com>
brentalanmiller pushed a commit to brentalanmiller/tonic that referenced this pull request Oct 6, 2023
* deps: update to rustls 0.21.0.

This commit updates tokio-rustls to use the freshly released Rustls
0.21.0 release tag, and the rustls-webpki fork of webpki.

* tests: improve server wait in early data test.

Previously the `test_0rtt` test had a hardcoded 1s sleep waiting for an
`openssl s_server` process to become ready.

If 1s waiting wasn't long enough, the test could fail with an error
like:

```
Error: Os { code: 10061, kind: ConnectionRefused, message: "No
connection could be made because the target machine actively refused
it." }
```

This commit replaces the hardcoded sleep with a sleep loop that
gradually increases the delay time up to a fixed maximum. This makes the
test run faster when the server is ready quickly and prevents an error
if it takes longer than 1s to stabilize.

* version: 0.23.4 -> 0.24.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants