(self, sid: str, path: Optional[str])
| 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: |
no test coverage detected