MCPcopy
hub / github.com/reflex-dev/reflex / modify_state_task

Function modify_state_task

tests/integration/test_lifespan.py:115–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

113 pass
114
115 async def modify_state_task():
116 from reflex.utils.prerequisites import get_app
117
118 reflex_app = get_app().app
119 try:
120 while True:
121 for token in list(connected_tokens):
122 async with reflex_app.modify_state(
123 BaseStateToken(ident=token, cls=LifespanState)
124 ) as state:
125 lifespan_state = await state.get_state(LifespanState)
126 lifespan_state.modify_count += 1
127 await asyncio.sleep(0.1)
128 except asyncio.CancelledError:
129 print("modify_state_task cancelled.")
130
131 def index():
132 return rx.vstack(

Callers

nothing calls this directly

Calls 5

get_appFunction · 0.90
BaseStateTokenClass · 0.90
printFunction · 0.50
modify_stateMethod · 0.45
get_stateMethod · 0.45

Tested by

no test coverage detected