duplex-message

A tinny(~3kb) utility that can simplify cross window(iframes, workers, same origin windows) and electron main / renderer process communications

MIT License

Downloads
112
Stars
9
Committers
3
duplex-message - v2.0.1 Latest Release

Published by oe 2 months ago

Add parameter heartbeatTimeout to the constructor of each class

heartbeatTimeout is timeout(milliseconds) for waiting heartbeat message, default 500ms

  1. A heartbeat message will be sent to peer immediately when a request message is received
    and there is at least one handler for it. Or the emit method will catch a no handler error
    It has nothing to do with the time of handler execution, there is no timeout
    for handler execution
  2. Normally, a heartbeat message will be sent to peer in less then 10 ms,
    but you may still need to set a longer timeout if browser is heavy loaded
    and the native apis are slow
duplex-message - v2.0.0

Published by oe 2 months ago

New features released:

  1. duplex-message'now adds BroadcastMessageHub which supports communication via BroadcastChannel
  2. .on now support multiple listeners on a single message
  3. debug logging is automatically enabled when process.env.NODE_ENV is any value other than production, and debug code will be stripped when process.env.NODE_ENV is production with a bundler
duplex-message - v1.1.0

Published by oe over 3 years ago

  1. all kinds of message hub are now supporting multi peers
  2. timeout is not needed when using StorageMessageHub
  3. add debug config, can be configured via setConfig({debug: true})
  4. add shared instance, can be accessed via these constructors.
duplex-message - v1.0

Published by oe over 3 years ago

Duplex-message official released! It's a replacement for @evecalm/message-hub

duplex-message - fix readme typos

Published by oe almost 4 years ago

Package Rankings
Top 9.51% on Npmjs.org