View Source Qnotix (Qnotix v1.0.0)
Qnotix is a minimalist Pub/Sub notification system written in Elixir based on just Plug Cowboy
module and websockets.
description
Description
Qnotix is a topic-based system, highly resilient, each topic running within its own, independent, supervised procees.
The Pub side feeds events using HTML Post API. The Sub side is dispatching events through websocket connection.
Both Pub and Sub sides depend and evolve on a named topic and its own port number.
The format of messages, JSON, is similar to that of ntfy. As Sub client, the ntfy Android app must be used, the flavor available on F-Droid (no Firebase). Not being an Android developer, I would greatly appreciate support for building a dedicated Android client for Qnotix.
Link to this section Summary
Functions
Kills a topic by its name or by port
Returns the port for a certain topic
Prints all running topics
Launch a new topic.
Launch a new topic on the desired port
Link to this section Functions
@spec endTopic(binary() | integer()) :: :no_such_topic | :no_topic_on_port | :ok | {:error, :not_found}
Kills a topic by its name or by port
parameters
Parameters
- topic(string): the name of new topic or
- port(integer)
example
Example
iex(3)> Qnotix.endTopic("hello")
:ok
Returns the port for a certain topic
parameters
Parameters
- topic(string): the name of new topic
example
Example
iex(1)> Qnotix.getPortFromTopic("hello")
4321
@spec getTopics() :: nil | [...]
Prints all running topics
examples
Examples
iex(1)> Qnotix.getTopics
[
%{pid: "#PID<0.398.0>", port: 4321, topic: "hello"},
%{pid: "#PID<0.507.0>", port: 4001, topic: "kkt"}
]
Launch a new topic.
parameters
Parameters
- topic(string): the name of new topic
examples
Examples
iex(1)> Qnotix.newTopic("Hello")
[notice] Topic Hello started on port 4001
{:ok, 4001}
Launch a new topic on the desired port
parameters
Parameters
- topic(string): the name of new topic
- port(integer): port number
examples
Examples
iex(1)> Qnotix.newTopic("hello",4321)
[notice] Topic hello started on port 4321
{:ok, 4321}