Did you know ... Search Documentation:
Packs (add-ons) for SWI-Prolog

Package "stompl"

Title:STOMP client
Rating:Not rated. Create the first rating!
Latest version:0.1
SHA1 sum:103c107f4cec8ee775d2fc79e760901032582bb1
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

Reviews

No reviews. Create the first review!.

Details by download location

VersionSHA1#DownloadsURL
0.1103c107f4cec8ee775d2fc79e760901032582bb12https://github.com/honnix/stompl.git

stompl

A STOMP client.

Installation

Using SWI-Prolog 7 or later.

?- pack_install('https://github.com/honnix/stompl.git').

Source code available and pull requests accepted here.

author
- Hongxin Liang <hxliang1982@gmail.com>
license
- Apache License Version 2.0

Supported STOMP versions

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.

Examples

:- 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.

License

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.

Contents of pack "stompl"

Pack contains 6 files holding a total of 21.5K bytes.