pulse-framework 0.1.68a1__py3-none-any.whl → 0.1.70__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -801,6 +801,7 @@ class InfiniteQuery(Generic[T, TParam], Disposable):
801
801
 
802
802
  @override
803
803
  def dispose(self):
804
+ self.cancel_gc()
804
805
  self._cancel_queue()
805
806
  if self._queue_task and not self._queue_task.done():
806
807
  self._queue_task.cancel()
pulse/queries/query.py CHANGED
@@ -576,6 +576,7 @@ class KeyedQuery(Generic[T], Disposable):
576
576
  @override
577
577
  def dispose(self):
578
578
  """Clean up the query, cancelling any in-flight fetch."""
579
+ self.cancel_gc()
579
580
  self.cancel()
580
581
  if self._interval_effect is not None:
581
582
  self._interval_effect.dispose()
pulse/render_session.py CHANGED
@@ -258,6 +258,7 @@ class RenderSession:
258
258
  _pending_api: dict[str, asyncio.Future[dict[str, Any]]]
259
259
  _pending_js_results: dict[str, asyncio.Future[Any]]
260
260
  _global_states: dict[str, State]
261
+ _global_queue: list[ServerMessage]
261
262
  _tasks: TaskRegistry
262
263
  _timers: TimerRegistry
263
264
 
@@ -283,6 +284,7 @@ class RenderSession:
283
284
  self._client_address = client_address
284
285
  self._send_message = None
285
286
  self._global_states = {}
287
+ self._global_queue = []
286
288
  self.query_store = QueryStore()
287
289
  self.connected = False
288
290
  self.channels = ChannelsManager(self)
@@ -319,6 +321,10 @@ class RenderSession:
319
321
  """WebSocket connected. Set sender, don't auto-flush (attach does that)."""
320
322
  self._send_message = send_message
321
323
  self.connected = True
324
+ if self._global_queue:
325
+ for msg in self._global_queue:
326
+ send_message(msg)
327
+ self._global_queue = []
322
328
 
323
329
  def disconnect(self):
324
330
  """WebSocket disconnected. Start queuing briefly before pausing."""
@@ -333,11 +339,20 @@ class RenderSession:
333
339
 
334
340
  def send(self, message: ServerMessage):
335
341
  """Route message based on mount state."""
342
+ # Global messages (not path-specific, or navigate_to) bypass mount state.
343
+ if message.get("type") == "navigate_to":
344
+ if self._send_message:
345
+ self._send_message(message)
346
+ else:
347
+ self._global_queue.append(message)
348
+ return
336
349
  # Global messages (not path-specific) go directly if connected
337
350
  path = message.get("path")
338
351
  if path is None:
339
352
  if self._send_message:
340
353
  self._send_message(message)
354
+ else:
355
+ self._global_queue.append(message)
341
356
  return
342
357
 
343
358
  # Normalize path for lookup
@@ -441,7 +456,6 @@ class RenderSession:
441
456
 
442
457
  if mount is None or mount.state == "idle":
443
458
  # Initial render must come from prerender
444
- print(f"[DEBUG] Missing or idle route '{path}', reloading")
445
459
  self.send({"type": "reload"})
446
460
  return
447
461
 
@@ -583,6 +597,7 @@ class RenderSession:
583
597
  if not fut.done():
584
598
  fut.cancel()
585
599
  self._pending_js_results.clear()
600
+ self._global_queue = []
586
601
  self._send_message = None
587
602
  self.connected = False
588
603
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pulse-framework
3
- Version: 0.1.68a1
3
+ Version: 0.1.70
4
4
  Summary: Pulse - Full-stack framework for building real-time React applications in Python
5
5
  Requires-Dist: websockets>=12.0
6
6
  Requires-Dist: fastapi>=0.128.0
@@ -80,15 +80,15 @@ pulse/queries/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
80
80
  pulse/queries/client.py,sha256=52T4MvorDr-T5UsJlndcEgnrPDs3QxIYP-MZtBSEuvc,18583
81
81
  pulse/queries/common.py,sha256=TYhn6LyldfmOKYYurxINgCEr3C3WSEwB0cIki1a5iBM,2488
82
82
  pulse/queries/effect.py,sha256=1ePUi2TwP49L9LhlkKI2qV_HhIO4jKj1r5jyPaWiUn8,1508
83
- pulse/queries/infinite_query.py,sha256=xWmFl5UqW7DXkquR-8EUPqlS6Z-ZF4l7qarEUUXjdN0,49091
83
+ pulse/queries/infinite_query.py,sha256=oyEheqi2z79_DaG0loZd5eIwfBSmqEURuTEyQeJRVBc,49110
84
84
  pulse/queries/mutation.py,sha256=fhEpOZ7CuHImH4Y02QapYdTJrwe6K52-keb0d67wmms,8274
85
85
  pulse/queries/protocol.py,sha256=TOrUiI4QK55xuh0i4ch1u96apNl12QeYafkf6RVDd08,3544
86
- pulse/queries/query.py,sha256=2VlYMeLqHfEokoEtocKjld8zi6Oy-_lieV4baTfF5DU,41332
86
+ pulse/queries/query.py,sha256=PhPUx975f1rO8ACiCiOCndrtuOmy4VA48ii3rIHUWRM,41351
87
87
  pulse/queries/store.py,sha256=4pWTDSl71LUM7YqhWanKjZkFh3t8F_04o48js_H4ttQ,3728
88
88
  pulse/react_component.py,sha256=8RLg4Bi7IcjqbnbEnp4hJpy8t1UsE7mG0UR1Q655LDk,2332
89
89
  pulse/reactive.py,sha256=GSh9wSH3THCBjDTafwWttyx7djeKBWV_KqjaKRYUNsA,31393
90
90
  pulse/reactive_extensions.py,sha256=yQ1PpdAh4kMvll7R15T72FOg8NFdG_HGBsGc63dawYk,33754
91
- pulse/render_session.py,sha256=7LmauQSUtRzYLTwwSmG7a6k3Z3u22rjVLpyWUd2iOIM,22808
91
+ pulse/render_session.py,sha256=RJgxJp_yRpDBr3l9ZFW0Eb6-dSp_urTzzPhPcHd0_Vo,23224
92
92
  pulse/renderer.py,sha256=fjSsUvCqV12jyN7Y5XspKUfjQJJzKX-Chha5oF5PrAk,16001
93
93
  pulse/request.py,sha256=N0oFOLiGxpbgSgxznjvu64lG3YyOcZPKC8JFyKx6X7w,6023
94
94
  pulse/requirements.py,sha256=nMnE25Uu-TUuQd88jW7m2xwus6fD-HvXxQ9UNb7OOGc,1254
@@ -122,7 +122,7 @@ pulse/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
122
122
  pulse/types/event_handler.py,sha256=psQCydj-WEtBcFU5JU4mDwvyzkW8V2O0g_VFRU2EOHI,1618
123
123
  pulse/user_session.py,sha256=nsnsMgqq2xGJZLpbHRMHUHcLrElMP8WcA4gjGMrcoBk,10208
124
124
  pulse/version.py,sha256=711vaM1jVIQPgkisGgKZqwmw019qZIsc_QTae75K2pg,1895
125
- pulse_framework-0.1.68a1.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
126
- pulse_framework-0.1.68a1.dist-info/entry_points.txt,sha256=i7aohd3QaPu5IcuGKKvsQQEiMYMe5HcF56QEsaLVO64,46
127
- pulse_framework-0.1.68a1.dist-info/METADATA,sha256=N5UMIoQUFFEIQVx38-aGoxveGbZkh_JRYwnL3AybWz0,8302
128
- pulse_framework-0.1.68a1.dist-info/RECORD,,
125
+ pulse_framework-0.1.70.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
126
+ pulse_framework-0.1.70.dist-info/entry_points.txt,sha256=i7aohd3QaPu5IcuGKKvsQQEiMYMe5HcF56QEsaLVO64,46
127
+ pulse_framework-0.1.70.dist-info/METADATA,sha256=zUio7-V0_fgct5WwsWMwjrTqqJLQpbIkcFoAVE8Syoc,8300
128
+ pulse_framework-0.1.70.dist-info/RECORD,,