frantic0 / sema-engine

A Signal Engine for a Live Code Language Ecosystem

Home Page:https://frantic0.github.io/sema-engine/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pack ringbuf for importScripts (and get rid of mlworkerscripts.js)

frantic0 opened this issue · comments

mlworkerscripts was hacked into existence for PAdenot's class Ringbuffer to be loaded with importScripts into the WorkerGlobalSpace.

That forced other issues such as having a bunch of code all dynamically loaded with geval, including:

MLSABOutputTransducer
createOutputChannel
input
output
outputSABs
inputSABs

The resolution was to standardise RingBuffer across the solution, import it directly from ringbuf.js (it has named export for the class RingBuffer) an assign it to a variable in the WorkerGlobalScope.

This still supports dynamic code eval in the worker.