moonzero · control plane v0.15.0 · 49 packages · 4 targets · Apache-2.0 docs / routing / discov GitHub

05 / ROUTING

discov

A moonsd Discovery over a file: publish writes what a memory registry holds, FileDiscovery resolves from it and watches it through moonbitlang/async's fs.

async fn publish(path : String, registry : @memory.Registry) -> Unit

itemWrite everything registry holds to path, replacing what was there.

struct FileDiscovery

structA @moonsd.Discovery over the file at path, and a file that is not there is no instances, so a reader can start before the publisher has written anything. It reads the file on every resolve, and a watcher wakes when the file's directory changes.

fn FileDiscovery::new(path : String) -> FileDiscovery

fn

extend FileDiscovery with @moonsd.Discovery::

item

impl @moonsd.Discovery for FileDiscovery with fn resolve(self, service)

item

impl @moonsd.Discovery for FileDiscovery with fn watch(self, service)

item