overdb
TypeScript icon, indicating that this package has built-in type declarations

0.0.10 • Public • Published

overdb

Simple virtual actor system

class Model {
    private counter = 0;

    async hello() {
        this.counter++;
        return this.counter;
    }
}

inject.when(MemoryPort).createSelf().asSingleton();

const c = await spawn(new Model());
const r = await c.hello();

const c2 = await actor(Model);
const r2 = await c2.hello();

expect(r2).toBe(2);
expect(await c.hello()).toBe(3);

const packed = Packer.pack(c);
const unpacked = Packer.unpack(packed) as Model; // ?

const result = await unpacked.hello() // ?

expect(result).toBe(4);
    

Readme

Keywords

none

Package Sidebar

Install

npm i overdb

Weekly Downloads

0

Version

0.0.10

License

MIT

Unpacked Size

18.9 kB

Total Files

7

Last publish

Collaborators

  • berhalak