File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ def unsubscribe(self, op_id):
43
43
async_iterator = self .remove_operation (op_id )
44
44
if hasattr (async_iterator , 'dispose' ):
45
45
async_iterator .dispose ()
46
+ return async_iterator
46
47
47
48
def unsubscribe_all (self ):
48
49
for op_id in list (self .operations ):
Original file line number Diff line number Diff line change 2
2
import inspect
3
3
from abc import ABC , abstractmethod
4
4
from types import CoroutineType , GeneratorType
5
- from typing import Any , Union , List , Dict
5
+ from typing import Any , Dict , List , Union
6
6
from weakref import WeakSet
7
7
8
8
from graphql .execution .executors .asyncio import AsyncioExecutor
@@ -89,7 +89,12 @@ def remember_task(self, task):
89
89
)
90
90
91
91
async def unsubscribe (self , op_id ):
92
- super ().unsubscribe (op_id )
92
+ async_iterator = super ().unsubscribe (op_id )
93
+ if (
94
+ getattr (async_iterator , "future" , None )
95
+ and async_iterator .future .cancel ()
96
+ ):
97
+ await async_iterator .future
93
98
94
99
async def unsubscribe_all (self ):
95
100
awaitables = [self .unsubscribe (op_id ) for op_id in list (self .operations )]
You can’t perform that action at this time.
0 commit comments