Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add connection level data container #2491

Merged
merged 20 commits into from
Dec 7, 2021
Merged

add connection level data container #2491

merged 20 commits into from
Dec 7, 2021

Conversation

robjtede
Copy link
Member

@robjtede robjtede commented Dec 6, 2021

PR Type

Fix

PR Checklist

  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • A changelog entry has been made for the appropriate packages.
  • Format code with the latest stable rustfmt.
  • (Team) Label with affected crates and semver status.

Overview

Second attempt to solve #1770 again without introducing unsafe code and fewer API breaks.

An Rc is kept in the dispatcher and cloned into a Request each time one is created for a connection. The API exposes read-only access to this container through request methods conn_data.

See on_connect example for how this changes the API in on_connect use cases.

Supercedes #2327

@robjtede robjtede added B-semver-major breaking change requiring a major version bump A-http project: actix-http A-web project: actix-web labels Dec 6, 2021
@robjtede robjtede requested a review from a team December 6, 2021 14:51
@robjtede
Copy link
Member Author

robjtede commented Dec 6, 2021

@ibraheemdev Hope it's alright to call you in as someone who reviewed the original PR.

@robjtede robjtede changed the title fix connection data on keep alive connections (no unsafe) add connection level data container Dec 6, 2021
@robjtede robjtede added this to the actix-web v4 milestone Dec 6, 2021
@robjtede robjtede requested a review from a team December 6, 2021 17:05
@aliemjay aliemjay self-assigned this Dec 7, 2021
@robjtede robjtede merged commit d35b764 into master Dec 7, 2021
@robjtede robjtede deleted the on-connect-fix-2 branch December 7, 2021 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-http project: actix-http A-web project: actix-web B-semver-major breaking change requiring a major version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add on_connect extension data to all subsequent calls made through the connection
2 participants