MCPcopy Create free account
hub / github.com/ScaleML/AgentSPEX / subscribe

Method subscribe

scripts/dashboard.py:563–583  ·  view source on GitHub ↗
(self, sid: str, path: Optional[str])

Source from the content-addressed store, hash-verified

561 return session
562
563 def subscribe(self, sid: str, path: Optional[str]) -> Optional[LogSession]:
564 with self.lock:
565 if not path:
566 path = self._default_path()
567 if not path:
568 return None
569 resolved = _safe_resolve(path)
570 if not resolved:
571 return None
572 resolved_str = str(resolved)
573
574 current = self.sid_to_path.get(sid)
575 if current and current != resolved_str:
576 self._leave_room(sid, current)
577
578 session = self._get_or_create(resolved)
579 self.sid_to_path[sid] = resolved_str
580 session.subscribers.add(sid)
581 join_room(session.room, sid=sid)
582 session.start()
583 return session
584
585 def unsubscribe(self, sid: str) -> None:
586 with self.lock:

Callers 3

handle_connectFunction · 0.80
handle_full_stateFunction · 0.80
handle_subscribeFunction · 0.80

Calls 6

_default_pathMethod · 0.95
_leave_roomMethod · 0.95
_get_or_createMethod · 0.95
_safe_resolveFunction · 0.85
getMethod · 0.80
startMethod · 0.45

Tested by

no test coverage detected