Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@platformatic/itc

Package Overview
Dependencies
Maintainers
7
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@platformatic/itc

Inter-Thread Communication (ITC) is a library for managing communication between threads in a multi-threaded application.

  • 2.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
133K
decreased by-33.17%
Maintainers
7
Weekly downloads
 
Created
Source

@platformatic/itc

Inter-Thread Communication (ITC) is a library for managing communication between threads in a multi-threaded application.

Install

npm install @platformatic/itc

Usage

const { MessageChannel } = require('node:worker_threads')
const { ITC } = require('@platformatic/itc')
const { port1, port2 } = new MessageChannel()


// thread 1
const itc1 = new ITC({ port: port1, name: 'thread-1' })

itc1.handle('get-users', async (request) => {
  return [{ id: 1, name: 'Alice' }, { id: 2, name: 'Bob' }]
})

itc1.listen()

// thread 2
const itc2 = new ITC({ port: port2, name: 'thread-2' })
itc2.listen()

const users = await itc2.send('get-users')
console.log(users)

License

Apache 2.0

FAQs

Package last updated on 01 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc