<commit_before>lua-mosquitto
=============

Lua bindings to the [libmosquitto](http://www.mosquitto.org/) client library.


Compile
-------
You need Lua and mosquitto development packages (headers and libs) to
build lua-mosquitto.

Compile with

    make

You can override the pkg-config package name to set a specific Lua version.
For example:

    make LUAPKGC=lua5.2

Example usage
-------------

Here is a very simple example that subscribes to the broker $SYS topic tree
and prints out the resulting messages:

```Lua
mqtt = require("mosquitto")
client = mqtt.new("test-id")

client.ON_CONNECT = function()
        print("connected")
        client:subscribe("$SYS/#")
end

client.ON_MESSAGE = function(mid, topic, payload)
        print(topic, payload)
end

client:connect(arg[1]) -- defaults to "localhost" if arg not set
client:loop_forever()
```
<commit_msg>README: remove the session id from example code<commit_after>lua-mosquitto
=============

Lua bindings to the [libmosquitto](http://www.mosquitto.org/) client library.


Compile
-------
You need Lua and mosquitto development packages (headers and libs) to
build lua-mosquitto.

Compile with

    make

You can override the pkg-config package name to set a specific Lua version.
For example:

    make LUAPKGC=lua5.2

Example usage
-------------

Here is a very simple example that subscribes to the broker $SYS topic tree
and prints out the resulting messages:

```Lua
mqtt = require("mosquitto")
client = mqtt.new()

client.ON_CONNECT = function()
        print("connected")
        client:subscribe("$SYS/#")
end

client.ON_MESSAGE = function(mid, topic, payload)
        print(topic, payload)
end

client:connect(arg[1]) -- defaults to "localhost" if arg not set
client:loop_forever()
```

{'fraction_non_alphanumeric': 0.12848209209778283, 'fraction_numerical': 0.0034110289937464467, 'mean_word_length': 3.7184986595174263, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3415059', 'n_tokens_mistral': 562, 'n_tokens_neox': 525, 'n_words': 187}