Socket
Socket
Sign inDemoInstall

grapewire

Package Overview
Dependencies
85
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    grapewire

Grapewire — MQTT client-local routing and upstream-subscriptions merger - the things you expected to be there, and nothing more


Version published
Weekly downloads
8
decreased by-61.9%
Maintainers
1
Install size
3.35 MB
Created
Weekly downloads
 

Readme

Source

Grapewire

It was called "Ratatosk", then "Ratatoskr", in-house. Now that we've extracted code for a WiP of open source, we realized there was another ratatoskr. So changed to the name that of an old pub/sub-lib based on ZMQ that I never published: "Grapewire".

MAJOR WARNING

This OSS-extraction is WiP - as long as you read this line - it's not ready for consumption. Expect a few more weeks or so more at least.

Objectives

  • Aims to do as little as possible, only what "one would expect", and just a tiny tiny tad more
  • Routes messages to topics within you application
    • The router can be used standalone without the sub-reduction management etc.
  • Upstream subscription topic reduction
    • Important - without this functionality you will receive multiple duplicates of messages as soon as you subscribe to moderately mixed topics with different wild cards
  • Does parameter extraction
    • We've switched the route-string-syntax to Express-router syntax for familiarity
  • Variable expansion
    • %c, %u is replaced with cliend_id and username, respectively, whether in publish or subscribe
  • Queues pubs and subs when disconnected. Sends pubs first.
  • Handles reconnecting
  • Currently utilizes mqtt.js as underlying transport
    • shouldn't be to hard to refactor to allow different implementations
  • Some additions that "aren't necessary"
    • You're allowed to use * instead of +, and ** instead of #
    • You're allowed to use ** in the middle of topic-patterns: MQTT doesn't support such patterns, so upstream the topic will be as wide as where the **/# first comes into play in the pattern
    • You can subscribe to "only messages that haven't been handled" - this will not generate subscribes upstream, only catch incoming messages after the regular queue when no handler has matcher or accepted them - TODO specs must change here.
    • There's a rcv function that subscribes for exactly one message. The unsubscription is handled in the router to ensure this contract.
  • Relies on Promises (async code style)
  • There is also a Kotlin-version that we use in Android - will be open sourced shortly
  • A Swift-version for iPhone is planned.

Keywords

FAQs

Last updated on 09 Apr 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc