Skip to content

New module to support Django Channels v2 #18

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

Merged
merged 85 commits into from
Mar 29, 2021
Merged
Changes from 1 commit
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
abd73b9
Django Channels v2
SmileyChris Jul 26, 2018
86762d3
Make the django app more uniquely named
SmileyChris Jul 26, 2018
d365c72
Split the channels 2 app into different modules
SmileyChris Jul 26, 2018
c9cda69
Update and simplify the channels2 example
SmileyChris Jul 26, 2018
2ce92ac
Support async generator responses in django channels
SmileyChris Jul 28, 2018
d46f6bd
Ensure graphql_ws submodules are installed
SmileyChris Aug 12, 2018
5829ff2
Ensure the graphiql template is added in the distribution
SmileyChris Aug 12, 2018
bc16ee5
Remove some unused observer code
SmileyChris Aug 21, 2018
5ddcb1b
Execute iterable operations as a separate task
SmileyChris Aug 21, 2018
dc478be
Add session_application helper to django routing
SmileyChris Aug 27, 2018
f0a2727
Behave correctly by cancelling async tasks
SmileyChris Aug 27, 2018
fe91dbb
Use lower level asyncio.wait, abstract the on_complete command
SmileyChris Aug 30, 2018
187ee78
Optimize unsubscribing to ops
SmileyChris Aug 31, 2018
99bc3a8
Cleaner iterable op running
SmileyChris Aug 31, 2018
7879f32
Simplify the django async futures
SmileyChris Sep 4, 2018
1eb443e
When closing a channels subscription, correctly await for the unsubsc…
SmileyChris Nov 20, 2018
d8d83ca
Merge branch 'master' into channels2
SmileyChris Nov 20, 2018
1eb83a5
Await pending promises in the payload
SmileyChris Jan 9, 2019
a99c1cf
Update pipfile.lock versions for django channels2 example
SmileyChris Mar 29, 2019
2e1ddfd
Get rid of rx.Observable django channels example, async is simpler
SmileyChris Jul 21, 2019
8d6fe93
Use common middleware in channels2 example
SmileyChris Jul 22, 2019
7e969a2
Change the graphql-core requirement to avoid 3.0.0a0 install in pip
SmileyChris Jul 23, 2019
d7a05bd
Merge remote-tracking branch 'upstream/master' into channels2
SmileyChris Jan 6, 2020
b1b15e0
Safer django socket sending
SmileyChris Jan 6, 2020
d7689b7
Add a django connection_context.closed prop
SmileyChris Jan 6, 2020
faea9cf
Django Channels connection closed fix
SmileyChris Jan 7, 2020
184367b
Fix a property collision in django connectioncontext
SmileyChris Jan 7, 2020
f805f3e
Ensure the Django subscription consumer cleans up any dangling tasks …
SmileyChris May 4, 2020
c00066b
Split base classes into sync and async
SmileyChris May 17, 2020
b6951ed
Fix tests to match deduplication changes
SmileyChris May 17, 2020
4fe4736
Add some base tests
SmileyChris Jun 1, 2020
f7ef09f
Add base async tests
SmileyChris Jun 6, 2020
944d949
Add django_channels tests
SmileyChris Jun 6, 2020
e4b3d9f
Remove a redundant check for an internal detail
SmileyChris May 19, 2020
7b21f0f
Move execute back to base
SmileyChris May 19, 2020
75cad35
Move operation unsubscription to BaseSubscriptionServer
SmileyChris Jun 25, 2020
e904b15
Black the example code
SmileyChris Jun 25, 2020
9499ae9
Black the modules in graphql_ws root
SmileyChris Jun 25, 2020
738f447
Skip flake8 false positives and remove unneeded import
SmileyChris Jun 28, 2020
f641e58
Update contributing doc
SmileyChris Jun 28, 2020
c007f58
Correctly test a bad graphql parameter
SmileyChris Jun 28, 2020
bb4f1be
Make removing an operation from context fail silently
SmileyChris Jun 28, 2020
a4eef79
Make async methods send an error if an operation raises an exception
SmileyChris Jun 28, 2020
3e670e6
Send completion messages when the sync observer completes / errors out.
SmileyChris Jun 28, 2020
650db34
Cody tidy
SmileyChris Jun 28, 2020
a8c2f33
Abstract ensuring async task is a future
SmileyChris Jun 29, 2020
8d32f4b
Tidy up django_channels (1) backend and example
SmileyChris Jun 29, 2020
7797c29
Update readme
SmileyChris Jun 29, 2020
cb5126a
Merge branch 'deduplicate' into channels2
SmileyChris Jun 29, 2020
d85df83
Use new abstracted base code for django channels 2
SmileyChris Jun 29, 2020
5ed4f1d
Fix a readme typo
SmileyChris Jun 30, 2020
a3197d0
Recursively resolve Promises, fix async tests
SmileyChris Jul 1, 2020
d879480
Merge commit 'deduplicate' into channels2
SmileyChris Jul 1, 2020
b6da149
Simplify django consumer now promises are resolved in the base
SmileyChris Jul 1, 2020
84d5d17
Ignore cancellederror when closing connections
SmileyChris Jul 29, 2020
6f72dec
Merge branch 'deduplicate' into channels2
SmileyChris Jul 29, 2020
a9e63be
Add the required receive method to ChannelsConnectionContext
SmileyChris Jul 29, 2020
7bfc590
Fix async processing messages
SmileyChris Jul 29, 2020
6284da1
Merge branch 'deduplicate' into HEAD
SmileyChris Jul 29, 2020
0cbcdef
Simpler receive_json
SmileyChris Jul 29, 2020
583f3f0
Fix async unsubscribe
SmileyChris Jul 29, 2020
9204c91
Merge branch 'deduplicate' into channels2
SmileyChris Jul 29, 2020
de8ced3
Move unsubscribe logic to the connection context
SmileyChris Jul 29, 2020
9bec86e
Remove a redundant async method
SmileyChris Jul 29, 2020
a1d2ebc
Only send messages for operations that exist
SmileyChris Jul 30, 2020
94d8740
Iterators are considered awaitable with the new method, so check only…
SmileyChris Jul 30, 2020
19871cf
Merge branch 'deduplicate' into channels2
SmileyChris Jul 30, 2020
218c7fc
Add request context directly to the payload rather than a request_con…
SmileyChris Jul 30, 2020
9a2aca3
Merge branch 'deduplicate' into channels2
SmileyChris Jul 30, 2020
ae0b0c7
Correctly unsubscribe after on_start operation is complete
SmileyChris Nov 24, 2020
81537ea
Merge branch 'deduplicate' into channels2
SmileyChris Nov 24, 2020
a964800
Fix tests
SmileyChris Nov 24, 2020
b81df97
Merge remote-tracking branch 'origin/deduplicate' into channels2
SmileyChris Nov 26, 2020
cdbdda1
Async unsubscription needs to wait around for the future to cancel
SmileyChris Mar 29, 2021
26fc75c
Merge branch 'deduplicate' into channels2
SmileyChris Mar 29, 2021
4554636
Allow collection of tests even if aiohttp isn't installed
SmileyChris Mar 29, 2021
56f46a1
Make the python 2 async observer send graphql error for exceptions ex…
SmileyChris Mar 29, 2021
5abd858
asyncio.wait receiving coroutines is deprecated, create tasks explicitly
SmileyChris Mar 29, 2021
d2d55a1
Tidy up a test warning
SmileyChris Mar 29, 2021
f7cb773
Rename TestServer to avoid it being collected by pytest
SmileyChris Mar 29, 2021
80890c3
Update test matrix
SmileyChris Mar 29, 2021
9ced609
Update travis python versions
SmileyChris Mar 29, 2021
3adfaa9
Try using a newer travis dist to fix cryptography building issues
SmileyChris Mar 29, 2021
703e407
Use python 3.6 friendly asyncio method
SmileyChris Mar 29, 2021
efcd905
Merge branch 'deduplicate' into channels2
SmileyChris Mar 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Iterators are considered awaitable with the new method, so check only…
… not aiter
  • Loading branch information
SmileyChris committed Jul 30, 2020
commit 94d874027edceb8ae56b80907db07d25db705cca
5 changes: 2 additions & 3 deletions graphql_ws/base_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,6 @@ async def on_start(self, connection_context, op_id, params):
execution_result = self.execute(params)

connection_context.register_operation(op_id, execution_result)
if is_awaitable(execution_result):
execution_result = await execution_result

if hasattr(execution_result, "__aiter__"):
iterator = await execution_result.__aiter__()
connection_context.register_operation(op_id, iterator)
Expand All @@ -160,6 +157,8 @@ async def on_start(self, connection_context, op_id, params):
await self.send_error(connection_context, op_id, e)
else:
try:
if is_awaitable(execution_result):
execution_result = await execution_result
await self.send_execution_result(
connection_context, op_id, execution_result
)
Expand Down