Skip to content

labctl/sros_yang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c767e28 · Apr 24, 2025

History

51 Commits
Jul 27, 2023
Jul 27, 2023
Apr 24, 2025
Jul 19, 2023
Apr 30, 2024
Jul 27, 2023
Jul 4, 2023
Jul 4, 2023

Repository files navigation

Yang module web worker

The yang worker decompresses, filters and compares compressed yang models.

Usage

// vite supports the ?worker syntax
import YangWorker from "./yangworker/worker.js?worker"

version = '23.3.R1'

const worker = new YangWorker()
worker.postMessage({ load: version } as WorkerRx)

worker.onmessage = (eventmsg) => {
  const msg = eventmsg.data as WorkerTx
  if (msg.info) {
    console.debug(`Loaded ${msg.info}`)
    // perform your first "get"...
    worker.postMessage({ get: {
        marks:['bgp'], ...other_options
    } } as WorkerRx)
  }
  if (msg.data) {
    console.debug(`WTx new data! ${msg.data.length}`)
  }
  if (msg.diffdata) {
    console.debug(`WTx new data! ${msg.diffdata.length}`)
  }
}