port_agent
Advanced tools
Comparing version 1.4.4 to 1.4.5
{ | ||
"name": "port_agent", | ||
"version": "1.4.4", | ||
"version": "1.4.5", | ||
"description": "A RPC-like facility for making inter-thread function calls.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -17,3 +17,3 @@ # Port Agent | ||
## Table of Contents | ||
## Table of contents | ||
@@ -40,8 +40,6 @@ - [Concepts](#concepts) | ||
### Instructions | ||
### How to create an Agent instance | ||
#### How to Create an Agent Instance | ||
#### Import the Agent class from Port Agent. | ||
Import the Agent class from Port Agent. | ||
```ts | ||
@@ -51,3 +49,3 @@ import { Agent } from "port_agent"; | ||
You can create a new Agent by passing a MessagePort or Worker instance to the Agent constructor: | ||
#### You can create a new Agent by passing a MessagePort or Worker instance to the Agent constructor. | ||
@@ -67,5 +65,5 @@ In the main thread, | ||
#### How to Use an Agent Instance | ||
### How to use an Agent instance | ||
You can register a function in the main thread or in a worker thread using the Agent.register method: | ||
#### You can register a function in the main thread or in a worker thread using the `agent.register` method. | ||
@@ -79,3 +77,3 @@ ```ts | ||
You can call a function registered in another thread (i.e., the main thread or a worker thread) using the Agent.call method: | ||
#### You can call a function registered in another thread (i.e., the main thread or a worker thread) using the `agent.call` method: | ||
@@ -89,13 +87,13 @@ ```ts | ||
### _A Simple Example_ <sup><sup>\</Node.js\></sup></sup> | ||
### _A simple example_ <sup><sup>\</Node.js\></sup></sup> | ||
Please see the [Simple Example](https://github.com/faranalytics/port_agent/tree/main/examples/simple) for a working implementation. | ||
Please see the [simple example](https://github.com/faranalytics/port_agent/tree/main/examples/simple) for a working implementation. | ||
### _A Comprehensive Example_ <sup><sup>\</TypeScript\></sup></sup> | ||
### _A comprehensive example_ <sup><sup>\</TypeScript\></sup></sup> | ||
Please see the [Comprehensive Example](https://github.com/faranalytics/port_agent/tree/main/examples/comprehensive) for a working implementation. | ||
Please see the [comprehensive example](https://github.com/faranalytics/port_agent/tree/main/examples/comprehensive) for a working implementation. | ||
## API | ||
### The Agent Class | ||
### The Agent class | ||
@@ -148,7 +146,7 @@ #### new port_agent.Agent(port) | ||
### Support for BroadcastChannels | ||
### Support for broadcastChannels | ||
Port Agent supports one to one communication over a `MessagePort`. `BroadcastChannel`s are not presently supported. | ||
### Support for other Communication Channels | ||
### Support for other communication channels | ||
@@ -159,4 +157,4 @@ Port Agent is strictly focused on efficient communication over `MessagePort`s. Port Agent will not support communication over other communication channels e.g., `Socket`s, IPC, etc. | ||
If you have a feature request or run into any issues, feel free to submit an [issue](https://github.com/faranalytics/port_agent/issues) or start a [discussion](https://github.com/faranalytics/port_agent/discussions). You’re also welcome to reach out directly to one of the authors at any time. | ||
If you have a feature request or run into any issues, feel free to submit an [issue](https://github.com/faranalytics/port_agent/issues) or start a [discussion](https://github.com/faranalytics/port_agent/discussions). You’re also welcome to reach out directly to one of the authors. | ||
- [Adam Patterson](https://github.com/adamjpatterson) |
17394
153