• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

emqx / emqx / 3744
68%
master: 82%

Build:
Build:
LAST BUILD BRANCH: bump-emqx-enterprise-dashboard-version-20251107-075738
DEFAULT BRANCH: master
Ran 09 Nov 2018 09:47AM UTC
Jobs 1
Files 86
Run time 7s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
3744

push

travis-ci

turtleDeng
Change the start_link API for emqx_client

Prior to this change, emqx_client:start_link does 2 works in one call:
- init an erlang process for emqx_client
- send MQTT CONNECT to remote broker

But this solution have some drawbacks:

- the return value of `start_link` compiles the return values of the 2
 works: {ok, Pid, MqttResult}. It is inconsistent with the return value
 of `gen_statem:start_link`, may causes confusions.

- the return mode of the 2 works are different:
  `start_link` should always return {ok, Pid} or {error, Reason}, but
 connecting to mqtt may throw out exceptions as it handles the
 socket. But the caller couldn't have thought of the exception, he would
 pattern match on the result of `emqx_client:start_link`, but it crashed!

- If the init work succeed but the connection failed, the caller couldn't
get a Pid from the return value, but indeed it was created inside the
emqx_client. This hides the fact that the Pid was created, and when the
Pid dies, the caller would receive an message from a Pid it doesn' know about.

This change divived these 2 work into 2 APIs:
- `start_link/1` is to build and verify the options, and returns {ok,Pid}
 (on success) or {error, Reason} (on failure).
- `connect/1` is to send MQTT CONNECT, and returns {ok, MQTTResult::properties()} or
 {error, MQTTReason}. MQTT reason codes will contains in the `MQTTReason`.

21 of 21 new or added lines in 2 files covered. (100.0%)

2737 of 4308 relevant lines covered (63.53%)

342.3 hits per line

Jobs
ID Job ID Ran Files Coverage
1 3744.1 09 Nov 2018 09:47AM UTC 0
63.53
Travis Job 3744.1
Source Files on build 3744
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #3744
  • 997958ae on github
  • Prev Build on emqx30 (#3743)
  • Next Build on emqx30 (#3747)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc