post-me

Home > post-me

post-me package

Use web Workers and other Windows through a simple Promise API

Classes

Class Description
BareMessenger  
ConcreteEmitter A concrete implementation of the Emitter interface
PortMessenger A concrete implementation of Messenger used to communicate with a MessagePort.
WindowMessenger A concrete implementation of Messenger used to communicate with another Window.
WorkerMessenger A concrete implementation of Messenger used to communicate with a Worker.

Functions

Function Description
ChildHandshake(messenger, localMethods) Initiate the handshake from the Child side
debug(namespace, log) Create a logger function with a specific namespace
DebugMessenger(messenger, log) Decorate a Messenger so that it will log any message exchanged
ParentHandshake(messenger, localMethods, maxAttempts, attemptsInterval) Initiate the handshake from the Parent side

Interfaces

Interface Description
Connection An active connection between two contexts
Emitter A simple event emitter interface used to implement the observer pattern throughout the codebase.
LocalHandle A handle to the local end of the connection
Messenger An interface used internally to exchange low level messages across contexts.
RemoteHandle A handle to the other end of the connection

Type Aliases

Type Alias Description
CallOptions The options that can be passed when calling a method on the other context with RemoteHandle.customCall()
EmitOptions The options that can be passed when emitting an event to the other context with LocalHandle.emit()