Skip to content
This repository was archived by the owner on Apr 24, 2020. It is now read-only.
This repository was archived by the owner on Apr 24, 2020. It is now read-only.

Massive refactoring underway #515

Description

@ronkorving

Just an FYI (to those interested, eg @kkoopa, @reqshark).

I'm completely refactoring what we export, as it's such a complete and utter mess right now, I want to prepare you for what's coming:

Removal of all constants on module.exports

Yes, all constants are gone. This is relevant, because some constants actually conflict with API (subscribe and unsubscribe for example are socket options, but also API). As ZMQ gets more and more socket options, this has become an unmanageable mess. Time for some clean up. That means that people will have to use getsockopt and setsockopt to access options. They may still use shorthand (last_endpoint) and full constant string names (ZMQ_LAST_ENDPOINT), as well as the actual integer representing the option.

No more module.exports = zmq; // the binding

The binding should be wrapped, not infested with all kinds of separate API.

A rewrite of how defined constants are registered

Currently, they're stored by number. In the upcoming PR they will be:

#ifdef ZMQ_LAST_ENDPOINT
  OPT(binary, ZMQ_LAST_ENDPOINT);
#endif

This macro will inject it into opts_binary and JS land: zmq.options (string -> int). All the options are gone from JS land. It's all driven from C++. JS just exposes it.
I'm taking this opportunity to add all missing options (there are a few).

Once all this is done, this will obviously mean major version bump.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions