Skip to content

ios: only buffer when requests support retries#521

Merged
rebello95 merged 2 commits intomasterfrom
buffer-retries-only-ios
Oct 18, 2019
Merged

ios: only buffer when requests support retries#521
rebello95 merged 2 commits intomasterfrom
buffer-retries-only-ios

Conversation

@rebello95
Copy link
Copy Markdown
Contributor

@rebello95 rebello95 commented Oct 17, 2019

Updates to utilize the options exposed in #520 to prevent unnecessarily buffering requests that will never be retried. This can be especially useful for preventing buffering of long-lived [gRPC] streams, for example.

We discussed having a full fledged platform level struct to parallel envoy_stream_options, but decided that while we only expose one option we can leave the API as a boolean argument.

Matching Android functionality is being tracked here: #524.

Signed-off-by: Michael Rebello me@michaelrebello.com

@rebello95 rebello95 changed the base branch from buffer-retry-only to master October 18, 2019 18:37
Signed-off-by: Michael Rebello <me@michaelrebello.com>
@rebello95 rebello95 force-pushed the buffer-retries-only-ios branch from b64150f to 063516b Compare October 18, 2019 18:38
Signed-off-by: Michael Rebello <me@michaelrebello.com>
@rebello95 rebello95 marked this pull request as ready for review October 18, 2019 18:44
@rebello95 rebello95 requested a review from junr03 October 18, 2019 18:44
Copy link
Copy Markdown
Member

@junr03 junr03 left a comment

Choose a reason for hiding this comment

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

Discussed offline having a full fledge platform level struct to parallel envoy_stream_options. Decided that while we only expose one option we can leave the API as an bool argument.

public func send(_ request: Request, handler: ResponseHandler) -> StreamEmitter {
let httpStream = self.engine.startStream(with: handler.underlyingCallbacks)
let httpStream = self.engine.startStream(
with: handler.underlyingCallbacks, bufferForRetry: request.retryPolicy != nil)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nice, the end-user does not have to know about the tie between the stream option and retrying.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep!

@rebello95 rebello95 merged commit 4e66cd7 into master Oct 18, 2019
@rebello95 rebello95 deleted the buffer-retries-only-ios branch October 18, 2019 19:38
junr03 added a commit that referenced this pull request Oct 23, 2019
Description: android parallel to #521.
Risk Level: low - matching ios functionality
Testing: unit tests

Signed-off-by: Jose Nino <jnino@lyft.com>
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