Load a subscriber cursor, returning `None` if not found.
(&self, session_id: &str, array_name: &str)
| 234 | |
| 235 | /// Load a subscriber cursor, returning `None` if not found. |
| 236 | fn load(&self, session_id: &str, array_name: &str) -> Option<ArraySubscriberState> { |
| 237 | let key = Self::cursor_key(session_id, array_name); |
| 238 | let txn = self.db.begin_read().ok()?; |
| 239 | let table = txn.open_table(CURSOR_TABLE).ok()?; |
| 240 | let entry = table.get(key.as_str()).ok()??; |
| 241 | zerompk::from_msgpack(entry.value()).ok() |
| 242 | } |
| 243 | |
| 244 | /// Delete all cursors for a given session (disconnect cleanup). |
| 245 | fn delete_session(&self, session_id: &str) { |