pulse-framework 0.1.66a1__py3-none-any.whl → 0.1.66a2__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.
- pulse/app.py +29 -37
- pulse/render_session.py +40 -52
- {pulse_framework-0.1.66a1.dist-info → pulse_framework-0.1.66a2.dist-info}/METADATA +1 -1
- {pulse_framework-0.1.66a1.dist-info → pulse_framework-0.1.66a2.dist-info}/RECORD +6 -6
- {pulse_framework-0.1.66a1.dist-info → pulse_framework-0.1.66a2.dist-info}/WHEEL +0 -0
- {pulse_framework-0.1.66a1.dist-info → pulse_framework-0.1.66a2.dist-info}/entry_points.txt +0 -0
pulse/app.py
CHANGED
|
@@ -546,13 +546,15 @@ class App:
|
|
|
546
546
|
route_info = payload.get("routeInfo")
|
|
547
547
|
debug = os.environ.get("PULSE_DEBUG_RENDER")
|
|
548
548
|
if debug:
|
|
549
|
-
|
|
550
|
-
"[PulseDebug][prerender] session=%s header_render_id=%s payload_render_id=%s paths=%s route_info=%s"
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
549
|
+
print(
|
|
550
|
+
"[PulseDebug][prerender] session=%s header_render_id=%s payload_render_id=%s paths=%s route_info=%s"
|
|
551
|
+
% (
|
|
552
|
+
session.sid,
|
|
553
|
+
request.headers.get("x-pulse-render-id"),
|
|
554
|
+
payload.get("renderId"),
|
|
555
|
+
paths,
|
|
556
|
+
route_info,
|
|
557
|
+
)
|
|
556
558
|
)
|
|
557
559
|
|
|
558
560
|
client_addr: str | None = get_client_address(request)
|
|
@@ -568,14 +570,10 @@ class App:
|
|
|
568
570
|
render_id, session, client_address=client_addr
|
|
569
571
|
)
|
|
570
572
|
if debug:
|
|
571
|
-
|
|
572
|
-
"[PulseDebug][prerender] session=%s render=%s reused=%s connected=%s"
|
|
573
|
-
session.sid,
|
|
574
|
-
render_id,
|
|
575
|
-
reused,
|
|
576
|
-
render.connected,
|
|
573
|
+
print(
|
|
574
|
+
"[PulseDebug][prerender] session=%s render=%s reused=%s connected=%s"
|
|
575
|
+
% (session.sid, render_id, reused, render.connected)
|
|
577
576
|
)
|
|
578
|
-
print(f"Prerendering for RenderSession {render_id}")
|
|
579
577
|
|
|
580
578
|
# Schedule cleanup timeout (will cancel/reschedule on activity)
|
|
581
579
|
if not render.connected:
|
|
@@ -713,7 +711,6 @@ class App:
|
|
|
713
711
|
):
|
|
714
712
|
# Expect renderId during websocket auth and require a valid user session
|
|
715
713
|
rid = auth.get("render_id") if auth else None
|
|
716
|
-
|
|
717
714
|
# Parse cookies from environ and ensure a session exists
|
|
718
715
|
cookie = self.cookie.get_from_socketio(environ)
|
|
719
716
|
if cookie is None:
|
|
@@ -721,10 +718,8 @@ class App:
|
|
|
721
718
|
session = await self.get_or_create_session(cookie)
|
|
722
719
|
debug = os.environ.get("PULSE_DEBUG_RENDER")
|
|
723
720
|
if debug:
|
|
724
|
-
|
|
725
|
-
"[PulseDebug][connect] session=%s render_id=%s",
|
|
726
|
-
session.sid,
|
|
727
|
-
rid,
|
|
721
|
+
print(
|
|
722
|
+
"[PulseDebug][connect] session=%s render_id=%s" % (session.sid, rid)
|
|
728
723
|
)
|
|
729
724
|
|
|
730
725
|
if not rid:
|
|
@@ -738,10 +733,9 @@ class App:
|
|
|
738
733
|
if render is None:
|
|
739
734
|
# The client will try to attach to a non-existing RouteMount, which will cause a reload down the line
|
|
740
735
|
if debug:
|
|
741
|
-
|
|
742
|
-
"[PulseDebug][connect] render_missing session=%s render_id=%s creating=true"
|
|
743
|
-
session.sid,
|
|
744
|
-
rid,
|
|
736
|
+
print(
|
|
737
|
+
"[PulseDebug][connect] render_missing session=%s render_id=%s creating=true"
|
|
738
|
+
% (session.sid, rid)
|
|
745
739
|
)
|
|
746
740
|
render = self.create_render(
|
|
747
741
|
rid, session, client_address=get_client_address_socketio(environ)
|
|
@@ -754,14 +748,10 @@ class App:
|
|
|
754
748
|
+ f"owner={owner} session={session.sid}"
|
|
755
749
|
)
|
|
756
750
|
if debug:
|
|
757
|
-
|
|
758
|
-
"[PulseDebug][connect] render_found session=%s render_id=%s owner=%s connected=%s"
|
|
759
|
-
session.sid,
|
|
760
|
-
render.id,
|
|
761
|
-
owner,
|
|
762
|
-
render.connected,
|
|
751
|
+
print(
|
|
752
|
+
"[PulseDebug][connect] render_found session=%s render_id=%s owner=%s connected=%s"
|
|
753
|
+
% (session.sid, render.id, owner, render.connected)
|
|
763
754
|
)
|
|
764
|
-
print(f"Connected to RenderSession {render.id}")
|
|
765
755
|
|
|
766
756
|
def on_message(message: ServerMessage):
|
|
767
757
|
payload = serialize(message)
|
|
@@ -879,13 +869,15 @@ class App:
|
|
|
879
869
|
"update",
|
|
880
870
|
"detach",
|
|
881
871
|
):
|
|
882
|
-
|
|
883
|
-
"[PulseDebug][client-message] session=%s render=%s type=%s path=%s route_info=%s"
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
872
|
+
print(
|
|
873
|
+
"[PulseDebug][client-message] session=%s render=%s type=%s path=%s route_info=%s"
|
|
874
|
+
% (
|
|
875
|
+
session.sid,
|
|
876
|
+
render.id,
|
|
877
|
+
msg["type"],
|
|
878
|
+
msg.get("path"),
|
|
879
|
+
msg.get("routeInfo"),
|
|
880
|
+
)
|
|
889
881
|
)
|
|
890
882
|
|
|
891
883
|
async def _next() -> Ok[None]:
|
pulse/render_session.py
CHANGED
|
@@ -139,12 +139,9 @@ class RouteMount:
|
|
|
139
139
|
return
|
|
140
140
|
action = self.pending_action
|
|
141
141
|
if os.environ.get("PULSE_DEBUG_RENDER"):
|
|
142
|
-
|
|
143
|
-
"[PulseDebug][mount-timeout] render=%s path=%s action=%s state=%s"
|
|
144
|
-
self.render.id,
|
|
145
|
-
self.path,
|
|
146
|
-
action,
|
|
147
|
-
self.state,
|
|
142
|
+
print(
|
|
143
|
+
"[PulseDebug][mount-timeout] render=%s path=%s action=%s state=%s"
|
|
144
|
+
% (self.render.id, self.path, action, self.state)
|
|
148
145
|
)
|
|
149
146
|
self.pending_action = None
|
|
150
147
|
if action == "dispose":
|
|
@@ -154,13 +151,9 @@ class RouteMount:
|
|
|
154
151
|
|
|
155
152
|
def start_pending(self, timeout: float, *, action: PendingAction = "idle") -> None:
|
|
156
153
|
if os.environ.get("PULSE_DEBUG_RENDER"):
|
|
157
|
-
|
|
158
|
-
"[PulseDebug][mount-pending] render=%s path=%s state=%s action=%s timeout=%s"
|
|
159
|
-
self.render.id,
|
|
160
|
-
self.path,
|
|
161
|
-
self.state,
|
|
162
|
-
action,
|
|
163
|
-
timeout,
|
|
154
|
+
print(
|
|
155
|
+
"[PulseDebug][mount-pending] render=%s path=%s state=%s action=%s timeout=%s"
|
|
156
|
+
% (self.render.id, self.path, self.state, action, timeout)
|
|
164
157
|
)
|
|
165
158
|
if self.state == "pending":
|
|
166
159
|
prev_action = self.pending_action
|
|
@@ -185,12 +178,14 @@ class RouteMount:
|
|
|
185
178
|
|
|
186
179
|
def activate(self, send_message: Callable[[ServerMessage], Any]) -> None:
|
|
187
180
|
if os.environ.get("PULSE_DEBUG_RENDER"):
|
|
188
|
-
|
|
189
|
-
"[PulseDebug][mount-activate] render=%s path=%s state=%s queued=%s"
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
181
|
+
print(
|
|
182
|
+
"[PulseDebug][mount-activate] render=%s path=%s state=%s queued=%s"
|
|
183
|
+
% (
|
|
184
|
+
self.render.id,
|
|
185
|
+
self.path,
|
|
186
|
+
self.state,
|
|
187
|
+
0 if not self.queue else len(self.queue),
|
|
188
|
+
)
|
|
194
189
|
)
|
|
195
190
|
if self.state != "pending":
|
|
196
191
|
return
|
|
@@ -219,10 +214,9 @@ class RouteMount:
|
|
|
219
214
|
if self.state != "pending":
|
|
220
215
|
return
|
|
221
216
|
if os.environ.get("PULSE_DEBUG_RENDER"):
|
|
222
|
-
|
|
223
|
-
"[PulseDebug][mount-idle] render=%s path=%s"
|
|
224
|
-
self.render.id,
|
|
225
|
-
self.path,
|
|
217
|
+
print(
|
|
218
|
+
"[PulseDebug][mount-idle] render=%s path=%s"
|
|
219
|
+
% (self.render.id, self.path)
|
|
226
220
|
)
|
|
227
221
|
self.state = "idle"
|
|
228
222
|
self.queue = None
|
|
@@ -350,14 +344,14 @@ class RenderSession:
|
|
|
350
344
|
def connect(self, send_message: Callable[[ServerMessage], Any]):
|
|
351
345
|
"""WebSocket connected. Set sender, don't auto-flush (attach does that)."""
|
|
352
346
|
if os.environ.get("PULSE_DEBUG_RENDER"):
|
|
353
|
-
|
|
347
|
+
print("[PulseDebug][render-connect] render=%s" % self.id)
|
|
354
348
|
self._send_message = send_message
|
|
355
349
|
self.connected = True
|
|
356
350
|
|
|
357
351
|
def disconnect(self):
|
|
358
352
|
"""WebSocket disconnected. Start queuing briefly before pausing."""
|
|
359
353
|
if os.environ.get("PULSE_DEBUG_RENDER"):
|
|
360
|
-
|
|
354
|
+
print("[PulseDebug][render-disconnect] render=%s" % self.id)
|
|
361
355
|
self._send_message = None
|
|
362
356
|
self.connected = False
|
|
363
357
|
|
|
@@ -432,11 +426,9 @@ class RenderSession:
|
|
|
432
426
|
"""
|
|
433
427
|
normalized = [ensure_absolute_path(path) for path in paths]
|
|
434
428
|
if os.environ.get("PULSE_DEBUG_RENDER"):
|
|
435
|
-
|
|
436
|
-
"[PulseDebug][prerender] render=%s paths=%s route_info=%s"
|
|
437
|
-
self.id,
|
|
438
|
-
normalized,
|
|
439
|
-
route_info,
|
|
429
|
+
print(
|
|
430
|
+
"[PulseDebug][prerender] render=%s paths=%s route_info=%s"
|
|
431
|
+
% (self.id, normalized, route_info)
|
|
440
432
|
)
|
|
441
433
|
|
|
442
434
|
results: dict[str, ServerInitMessage | ServerNavigateToMessage] = {}
|
|
@@ -447,12 +439,9 @@ class RenderSession:
|
|
|
447
439
|
mount = self.route_mounts.get(path)
|
|
448
440
|
if os.environ.get("PULSE_DEBUG_RENDER"):
|
|
449
441
|
route_label = repr(route)
|
|
450
|
-
|
|
451
|
-
"[PulseDebug][prerender] render=%s path=%s mount_state=%s route=%s"
|
|
452
|
-
self.id,
|
|
453
|
-
path,
|
|
454
|
-
mount.state if mount else None,
|
|
455
|
-
route_label,
|
|
442
|
+
print(
|
|
443
|
+
"[PulseDebug][prerender] render=%s path=%s mount_state=%s route=%s"
|
|
444
|
+
% (self.id, path, mount.state if mount else None, route_label)
|
|
456
445
|
)
|
|
457
446
|
|
|
458
447
|
if mount is None:
|
|
@@ -493,13 +482,15 @@ class RenderSession:
|
|
|
493
482
|
|
|
494
483
|
if mount is None or mount.state == "idle":
|
|
495
484
|
if os.environ.get("PULSE_DEBUG_RENDER"):
|
|
496
|
-
|
|
497
|
-
"[PulseDebug][attach] render=%s path=%s mount_state=%s mounts=%s route_info=%s"
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
485
|
+
print(
|
|
486
|
+
"[PulseDebug][attach] render=%s path=%s mount_state=%s mounts=%s route_info=%s"
|
|
487
|
+
% (
|
|
488
|
+
self.id,
|
|
489
|
+
path,
|
|
490
|
+
mount.state if mount else None,
|
|
491
|
+
{key: value.state for key, value in self.route_mounts.items()},
|
|
492
|
+
route_info,
|
|
493
|
+
)
|
|
503
494
|
)
|
|
504
495
|
# Initial render must come from prerender
|
|
505
496
|
print(f"[DEBUG] Missing or idle route '{path}', reloading")
|
|
@@ -510,10 +501,9 @@ class RenderSession:
|
|
|
510
501
|
mount.update_route(route_info)
|
|
511
502
|
if mount.state == "pending" and self._send_message:
|
|
512
503
|
if os.environ.get("PULSE_DEBUG_RENDER"):
|
|
513
|
-
|
|
514
|
-
"[PulseDebug][attach] render=%s path=%s activating=true"
|
|
515
|
-
self.id,
|
|
516
|
-
path,
|
|
504
|
+
print(
|
|
505
|
+
"[PulseDebug][attach] render=%s path=%s activating=true"
|
|
506
|
+
% (self.id, path)
|
|
517
507
|
)
|
|
518
508
|
mount.activate(self._send_message)
|
|
519
509
|
|
|
@@ -531,11 +521,9 @@ class RenderSession:
|
|
|
531
521
|
if current is not mount:
|
|
532
522
|
return
|
|
533
523
|
if os.environ.get("PULSE_DEBUG_RENDER"):
|
|
534
|
-
|
|
535
|
-
"[PulseDebug][mount-dispose] render=%s path=%s state=%s"
|
|
536
|
-
self.id,
|
|
537
|
-
path,
|
|
538
|
-
mount.state,
|
|
524
|
+
print(
|
|
525
|
+
"[PulseDebug][mount-dispose] render=%s path=%s state=%s"
|
|
526
|
+
% (self.id, path, mount.state)
|
|
539
527
|
)
|
|
540
528
|
try:
|
|
541
529
|
self.route_mounts.pop(path, None)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
pulse/__init__.py,sha256=cXNVXz0aizbkOG1aj2zytgzodyVNv7nNylsXcWmH-Lc,32183
|
|
2
2
|
pulse/_examples.py,sha256=dFuhD2EVXsbvAeexoG57s4VuN4gWLaTMOEMNYvlPm9A,561
|
|
3
|
-
pulse/app.py,sha256=
|
|
3
|
+
pulse/app.py,sha256=WjQ1ObPwt4GIqvVcuXAjoVg8bKHkmA_T3pigzcrMEns,37195
|
|
4
4
|
pulse/channel.py,sha256=ePpvD2mDbddt_LMxxxDjNRgOLbVi8Ed6TmJFgkrALB0,15790
|
|
5
5
|
pulse/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
pulse/cli/cmd.py,sha256=zh3Ah6c16cNg3o_v_If_S58Qe8rvxNe5M2VrTkwvDU8,15957
|
|
@@ -88,7 +88,7 @@ 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=
|
|
91
|
+
pulse/render_session.py,sha256=6CF6luXFOGyXSommXn2Fsou7N9mwMFw6jYHf-HArd3U,24808
|
|
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.
|
|
126
|
-
pulse_framework-0.1.
|
|
127
|
-
pulse_framework-0.1.
|
|
128
|
-
pulse_framework-0.1.
|
|
125
|
+
pulse_framework-0.1.66a2.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
|
|
126
|
+
pulse_framework-0.1.66a2.dist-info/entry_points.txt,sha256=i7aohd3QaPu5IcuGKKvsQQEiMYMe5HcF56QEsaLVO64,46
|
|
127
|
+
pulse_framework-0.1.66a2.dist-info/METADATA,sha256=xczQ4fBaXBgyTivHTgJF2Q_Tp2aGv8e9Z2kdlO3F02U,8302
|
|
128
|
+
pulse_framework-0.1.66a2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|