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

feat(socketio/extensions): rework extensions and add an Extension decorator and an HttpExtension decorator #309

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

Totodore
Copy link
Owner

@Totodore Totodore commented Apr 20, 2024

Modify the Extension implementation

  • Use a RwLock<HashMap> rather than a DashMap for concurrent access.
  • Add a clone bound on the data and directly Clone the returned data from get
  • Remove get_mut fn

Add

  • an Extension extractor.
  • an HttpExtension extractor that extracts from the HttpRequest.

Refactor

  • Split the extract module into submodules

Todo

  • Update documentation

Resolves issue :

@Totodore Totodore added bug Something isn't working socketio-v4 It is only about the version 4 of the socket.io protocol socketio-v5 It is only about the version 5 of the socket.io protocol labels Apr 20, 2024
@Totodore Totodore marked this pull request as draft April 20, 2024 01:44

This comment has been minimized.

@Totodore Totodore changed the title Feat: rework extensions and add an Extension decorator and an HttpExtension decorator feat(socketio/extensions): rework extensions and add an Extension decorator and an HttpExtension decorator Apr 20, 2024

This comment has been minimized.

This comment has been minimized.

Copy link

github-actions bot commented May 6, 2024

🐰Bencher

ReportTue, May 21, 2024 at 13:38:12 UTC
ProjectSocketioxide
Branchfeat-extensions-rework
Testbedubuntu-latest

⚠️ WARNING: The following Measure does not have a Threshold. Without a Threshold, no Alerts will ever be generated!

  • Latency (latency)

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

Click to view all benchmark results
BenchmarkLatencyLatency Results
nanoseconds (ns)
engineio_packet/decode/Decode packet binary b64➖ (view plot)87.48
engineio_packet/decode/Decode packet message➖ (view plot)40.12
engineio_packet/decode/Decode packet noop➖ (view plot)34.58
engineio_packet/decode/Decode packet ping/pong➖ (view plot)31.03
engineio_packet/decode/Decode packet ping/pong upgrade➖ (view plot)36.04
engineio_packet/encode/Encode packet binary b64➖ (view plot)56.98
engineio_packet/encode/Encode packet message➖ (view plot)33.96
engineio_packet/encode/Encode packet noop➖ (view plot)33.70
engineio_packet/encode/Encode packet open➖ (view plot)289.71
engineio_packet/encode/Encode packet ping/pong➖ (view plot)32.33
engineio_packet/encode/Encode packet ping/pong upgrade➖ (view plot)32.56
extensions/concurrent_get➖ (view plot)6.91
extensions/concurrent_get_inserts➖ (view plot)14.85
extensions/concurrent_inserts➖ (view plot)21.07
socketio_packet/decode/Decode packet ack on /➖ (view plot)282.36
socketio_packet/decode/Decode packet ack on /custom_nsp➖ (view plot)303.93
socketio_packet/decode/Decode packet binary ack (b64) on /➖ (view plot)512.42
socketio_packet/decode/Decode packet binary ack (b64) on /custom_nsp➖ (view plot)522.08
socketio_packet/decode/Decode packet binary event (b64) on /➖ (view plot)595.14
socketio_packet/decode/Decode packet binary event (b64) on /custom_nsp➖ (view plot)614.65
socketio_packet/decode/Decode packet connect on /➖ (view plot)62.87
socketio_packet/decode/Decode packet connect on /custom_nsp➖ (view plot)79.13
socketio_packet/decode/Decode packet event on /➖ (view plot)364.66
socketio_packet/decode/Decode packet event on /custom_nsp➖ (view plot)380.23
socketio_packet/decode/Decode packet event with ack on /➖ (view plot)357.17
socketio_packet/decode/Decode packet event with ack on /custom_nsp➖ (view plot)378.20
socketio_packet/encode/Encode packet ack on /➖ (view plot)115.67
socketio_packet/encode/Encode packet ack on /custom_nsp➖ (view plot)120.08
socketio_packet/encode/Encode packet binary ack (b64) on /➖ (view plot)314.74
socketio_packet/encode/Encode packet binary ack (b64) on /custom_nsp➖ (view plot)320.09
socketio_packet/encode/Encode packet binary event (b64) on /➖ (view plot)394.93
socketio_packet/encode/Encode packet binary event (b64) on /custom_nsp➖ (view plot)416.24
socketio_packet/encode/Encode packet connect on /➖ (view plot)52.31
socketio_packet/encode/Encode packet connect on /custom_nsp➖ (view plot)55.02
socketio_packet/encode/Encode packet event on /➖ (view plot)125.63
socketio_packet/encode/Encode packet event on /custom_nsp➖ (view plot)130.41
socketio_packet/encode/Encode packet event with ack on /➖ (view plot)124.34
socketio_packet/encode/Encode packet event with ack on /custom_nsp➖ (view plot)130.03

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working socketio-v4 It is only about the version 4 of the socket.io protocol socketio-v5 It is only about the version 5 of the socket.io protocol
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot keep ref to extension objects across .await points in handlers/middlewares
1 participant