Skip to content
/ wpc Public

Simple RPC solution for Workers, SharedWorkers and ServiceWorkers.

License

Notifications You must be signed in to change notification settings

geut/wpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Feb 6, 2022
91865cc · Feb 6, 2022

History

20 Commits
Feb 6, 2022
Nov 19, 2021
Sep 28, 2021
Sep 28, 2021
Sep 28, 2021
Sep 28, 2021
Sep 28, 2021
Sep 28, 2021
Feb 6, 2022
Feb 6, 2022

Repository files navigation

wpc

Simple RPC solution for Workers, SharedWorkers and ServiceWorkers.

Build Status JavaScript Style Guide standard-readme compliant

Made by GEUT

Install

$ npm install @geut/wpc

Usage

import { WPC } from '@geut/wpc'

// main-thread.js
const rpc = new WPC(/** @type {Worker|MessagePort} */)
rpc.actions({
  ping: () => 'pong'
})

// worker-thread.js
const rpc = new WPC(self)
await rpc.call('ping') // returns pong

Issues

🐛 If you found an issue we encourage you to report it on github. Please specify your OS and the actions to reproduce it.

Contributing

👥 Ideas and contributions to the project are welcome. You must follow this guideline.

License

MIT © A GEUT project

About

Simple RPC solution for Workers, SharedWorkers and ServiceWorkers.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published