<commit_before>erlmqtt
=======

An Erlang client library for MQTT 3.1.

### Building

    $ make

### Testing

    $ make test && make dialyse

### Trying out

(Assuming RabbitMQ or another MQTT broker is running on localhost:1883)

    $ erl -pa ebin

    1> {ok, C} = mqtt_connection:start_link().
    2> mqtt_connection:connect(C, "localhost", "client1").
    3> mqtt_connection:publish(C, "topic/a/b", <<"payload">>).<commit_msg>Give (updated) examples of subscribing and receiving messages<commit_after>erlmqtt
=======

An Erlang client library for MQTT 3.1 (but not for MQTT 3.1.1, yet).

### Building

    $ make

### Testing

    $ make test && make dialyse

### Trying out

(Assuming RabbitMQ or another MQTT broker is running on localhost:1883)

    $ erl -pa ebin

*Subscribing*

    1> {ok, C} = mqtt_connection:start_link().
    2> ok = mqtt_connection:connect(C, "localhost", "client1").
    3> {ok, Ref} = mqtt_connection:subscribe(C, [{"topic/#", at_most_once}]).
    4> receive {Ref, Reply} -> Reply after 1000 -> timeout end.

*Publishing*

    5> mqtt_connection:publish(C, "topic/a/b", <<"payload">>).

*Receiving messages*

    6> receive {frame, Msg} -> Msg after 5000 -> timeout end.

This API is likely to change, especially with respect to receiving
messages.
{'fraction_non_alphanumeric': 0.14563862928348908, 'fraction_numerical': 0.0264797507788162, 'mean_word_length': 3.724264705882353, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '388116', 'n_tokens_mistral': 485, 'n_tokens_neox': 437, 'n_words': 137}