Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/artemeff/pipe

pipe mq; unfinished application for customer; just for inspect, not for use
https://github.com/artemeff/pipe

Last synced: 12 days ago
JSON representation

pipe mq; unfinished application for customer; just for inspect, not for use

Awesome Lists containing this project

README

        

### pipe mq; unfinished application for client; just for inspect, not for use

---

### Usage

__Users__

```elixir
# send message to user process, process id stored in redis
:gen_server.call :users, { :notify, user_id, message }

# store process id by user id
:gen_server.call :users, { :subscribe, user_id, pid }

# drop process id
:gen_server.call :users, { :unsubscribe, user_id }

# get user PID by user_id, whet it not exists
# we spawn new process and return new PID
:gen_server.call :users, { :pid, 123 }

# get all user sessions by his user_id
# returns false if session doesn't exist
# or return user_id when it exist
:gen_server.call :users, { :session, "session_id" }

# get all user sessions by his user_id
# returns empty array ([]) when user hasn't
# any sessions, or return his sessions array
:gen_server.call :users, { :sessions, 123 }

# get user online state by user_id
# returns only false or true
:gen_server.call :users, { :online, 123 }

# set user online state by user_id
:gen_server.call :users, { :online, 123, state }
```

__WebSockets__

`http://0.0.0.0:8080`

By default it attaching to `http://0.0.0.0:8080` and anyone allow to get this page.

__Internal API__

`tcp://127.0.0.1:1234`

ZeroMQ listens on tcp://127.0.0.1:1234, API doesn't implement at now.