View Source Method Overview

This guide is a simple collection of examples for the JSON requests the default methods accept and the JS objects they return. (see Tamnoon.Methods)

get

{
    "method": "get",
    "key": "your key"
}

Returns: {key: value} or {error: "Error: no matching key"}

update

{
    "method": "update",
    "key": "your key",
    "val": "your new value"
}

Returns: {key: value} or {error: "Error: no matching key"}

sub

{
    "method": "sub",
    "channel": "your channel"
}

Returns: {sub: :ok}

unsub

{
    "method": "unsub",
    "channel": "your channel"
}

Returns: {unsub: :ok} or {error: "Error: can't unsub from clients channel"}

pub

{
    "method": "pub",
    "channel": "your channel",
    "action": {
        "method": "any method",
        ...
    }
}

Returns: {pub: :ok}

subbed_channels

{
    "method": "subbed_channels"
}

Returns: {subbed_channels: channels_array}