| Did you know ... | Search Documentation: |
| Packs (add-ons) for SWI-Prolog |
| Title: | STOMP client |
|---|---|
| Rating: | Not rated. Create the first rating! |
| Latest version: | 0.1 |
| SHA1 sum: | b3ddf8ec28bbca5616e36c781788f70a3482f8af |
| Author: | Honnix Liang <hxliang1982@gmail.com> |
| Maintainer: | Honnix Liang <hxliang1982@gmail.com> |
| Packager: | Honnix Liang <hxliang1982@gmail.com> |
| Home page: | https://github.com/honnix/stompl |
| Download URL: | https://github.com/honnix/stompl/archive/v0.1.zip |
No reviews. Create the first review!.
| Version | SHA1 | #Downloads | URL |
|---|---|---|---|
| 0.1 | 103c107f4cec8ee775d2fc79e760901032582bb1 | 9 | https://github.com/honnix/stompl.git |
| b3ddf8ec28bbca5616e36c781788f70a3482f8af | 9 | https://github.com/honnix/stompl.git |
_Note: this no long works and please refer to this fork: https://github.com/JanWielemaker/stompl_
A STOMP client.
Using SWI-Prolog 7 or later.
?- pack_install('https://github.com/honnix/stompl.git').
Source code available and pull requests accepted here.
Version 1.0 and 1.1 are supported, while 1.2 is not intentionally because I don't like '\r\n', plus it doesn't bring many new features.
:- module(ex, []).
:- use_module(library(stompl)).
ex :-
connection('192.168.99.100':32772,
_{
on_connected: ex:on_connected,
on_message: ex:on_message,
on_disconnected: ex:on_disconnected,
on_error: ex:on_error,
on_heartbeat_timeout: ex1:on_heartbeat_timeout
},
Connection),
setup(Connection),
connect(Connection, '/', _{'heart-beat':'5000,5000'}),
%% go ahead with something else
...
on_connected(Connection, Headers, Body) :-
...
on_message(Connection, Headers, Body) :-
...
on_disconnected(Connection) :-
...
on_error(Connection, Headers, Body) :-
...
on_heartbeat_timeout(Connection) :-
...
For more examples, please check source code under examples directory.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Pack contains 6 files holding a total of 21.6K bytes.