/** * Hachette storage through connection (server side) * * Copyright (C) 2021 Wojtek Kosior * Redistribution terms are gathered in the `copyright' file. */ /* * IMPORTS_START * IMPORT listen_for_connection * IMPORT get_storage * IMPORT TYPE_PREFIX * IMPORT CONNECTION_TYPE * IMPORTS_END */ var storage; async function handle_remote_call(port, message) { let [call_id, func, args] = message; try { let result = await Promise.resolve(storage[func](...args)); port.postMessage({call_id, result}); } catch (error) { error = error + ''; port.postMessage({call_id, error}); } } function remove_storage_listener(cb) { storage.remove_change_listener(cb); } function new_connection(port) { console.log("new remote storage connection!"); port.postMessage({ [TYPE_PREFIX.SCRIPT] : storage.get_all(TYPE_PREFIX.SCRIPT), [TYPE_PREFIX.BAG] : storage.get_all(TYPE_PREFIX.BAG), [TYPE_PREFIX.PAGE] : storage.get_all(TYPE_PREFIX.PAGE) }); let handle_change = change => port.postMessage(change); storage.add_change_listener(handle_change); port.onMessage.addListener(m => handle_remote_call(port, m)); port.onDisconnect.addListener(() => remove_storage_listener(handle_change)); } async function start_storage_server() { storage = await get_storage(); listen_for_connection(CONNECTION_TYPE.REMOTE_STORAGE, new_connection); } /* * EXPORTS_START * EXPORT start_storage_server * EXPORTS_END */ .scm?id=e96ccb3152f96fd2fa11019fbfec3101c9e2a7a0'>diff
path: root/gnu/packages/sphinx.scm
AgeCommit message (Expand)Author
2023-05-07gnu: python-sphinx-4: Fix sanity-check failure...Zongyuan Li
2023-04-16gnu: sphinx: Update minimum docutils version to 0.19....Brian Cully
2023-04-14Merge branch 'master' into core-updates....Maxim Cournoyer
2023-04-13gnu: python-breathe: Update to 4.35.0....Antero Mejr
2023-03-20Merge remote-tracking branch 'origin/master' into core-updatesAndreas Enge
2023-03-12gnu: python-sphinxcontrib-apidoc: Remove python-pre-commit....Antero Mejr
2023-01-30Merge remote-tracking branch 'origin/master' into core-updates...Efraim Flashner
2022-11-06gnu: Add python-myst-parser....Maxim Cournoyer
2022-11-06gnu: Add python-sphinx-pytest....Maxim Cournoyer
2022-09-15Merge branch 'staging' into core-updates...Maxim Cournoyer
2022-09-15Merge branch 'master' into staging...Maxim Cournoyer
2022-09-11gnu: python-sphinx-theme-builder: Update to 0.2.0b1....Marius Bakke
2022-09-11gnu: Add python-sphinx-tabs....Marius Bakke
2022-08-27Merge branch 'staging' into core-updatesMarius Bakke
2022-08-13gnu: texlive-hyperref: Propagate more inputs....Marius Bakke
2022-08-13gnu: python-sphinx-panels: Use python-sphinx@4....Marius Bakke
2022-08-13gnu: python-sphinx: Add 4.5.0....Marius Bakke
2022-08-13gnu: python-sphinx: Update to 5.1.1....Marius Bakke