File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,10 @@ or create a
2323[ pull request] ( https://github.com/rmorshea/idom/pulls ) . Thanks in advance!
2424
2525<h3 >
26- <a href =" https://mybinder.org/v2/gh/rmorshea/idom/master?filepath=notebooks%2Fintroduction.ipynb " >
26+ <a
27+ target="_ blank"
28+ href="https://mybinder.org/v2/gh/idom-team/idom-jupyter/master?filepath=notebooks%2Fintroduction.ipynb "
29+ >
2730 Try it Now
2831 <img alt="Binder" valign="bottom" height="25px"
2932 src="https://mybinder.org/badge_logo.svg"
Original file line number Diff line number Diff line change @@ -99,6 +99,13 @@ def __init__(self, layout: Layout) -> None:
9999 self ._model_state : Any = {}
100100 self ._update_queues : Dict [str , asyncio .Queue [LayoutUpdate ]] = {}
101101
102+ async def start (self ) -> None :
103+ await self .__aenter__ ()
104+
105+ async def stop (self ):
106+ self .task_group .cancel_scope .cancel ()
107+ await self .__aexit__ (None , None , None )
108+
102109 @async_resource
103110 async def task_group (self ) -> AsyncIterator [TaskGroup ]:
104111 async with create_task_group () as group :
Original file line number Diff line number Diff line change @@ -167,13 +167,13 @@ async def _activate_dispatcher(
167167 self , app : Sanic , loop : asyncio .AbstractEventLoop
168168 ) -> None :
169169 self ._dispatcher = cast (SharedViewDispatcher , self ._make_dispatcher ({}, loop ))
170- await self ._dispatcher .__aenter__ ()
170+ await self ._dispatcher .start ()
171171
172172 async def _deactivate_dispatcher (
173173 self , app : Sanic , loop : asyncio .AbstractEventLoop
174174 ) -> None : # pragma: no cover
175- # this doesn't seem to get triffered during testing for some reason
176- await self ._dispatcher .__aexit__ ( None , None , None )
175+ # this doesn't seem to get triggered during testing for some reason
176+ await self ._dispatcher .stop ( )
177177
178178 async def _run_dispatcher (
179179 self ,
You can’t perform that action at this time.
0 commit comments