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

InMemoryChannelLayer improvements, test fixes #1976

Merged
merged 8 commits into from
Jul 30, 2024

Conversation

devkral
Copy link
Contributor

@devkral devkral commented Feb 9, 2023

Improvements to InMemoryChannelLayer

  • honor expiry / don't block for eternity
  • honor per channel capacities
  • threadsafer cleaning design with atomic operations
  • parallel sending

Bugfixes tests

  • channel_layer is sometimes overwritten and the tests become bogus

@devkral
Copy link
Contributor Author

devkral commented Feb 16, 2023

Note: I made an mistake with:

  • honor expiry / don't block for eternity
    This is the correct behavior for receive.
    But maybe the receive method it should be put in a loop, in case the queue is expired
    (see devkral/channels-multiprocessing for an example)

Copy link
Collaborator

@bigfootjon bigfootjon left a comment

Choose a reason for hiding this comment

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

Thanks for the quick reply, sorry I'm just getting back to you.

This looks reasonable to me, I just have a few questions so I'm marking it as requested changes.

channels/layers.py Show resolved Hide resolved
channels/layers.py Outdated Show resolved Hide resolved
tests/test_inmemorychannel.py Show resolved Hide resolved
channels/layers.py Show resolved Hide resolved
channels/layers.py Show resolved Hide resolved
@bigfootjon bigfootjon self-requested a review July 30, 2024 01:19
channels/layers.py Show resolved Hide resolved
@bigfootjon bigfootjon merged commit e533186 into django:main Jul 30, 2024
6 checks passed
@devkral devkral deleted the fixes/inmemory branch July 30, 2024 12:43
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