Sha256: 20b390a8397578459236d5c2c87af2a2b4c6339790e422793613b0d01dfef572

Contents?: true

Size: 892 Bytes

Versions: 1

Compression:

Stored size: 892 Bytes

Contents

# deepstream-ruby
deepstream.io ruby client


### Install

```
gem install deepstream
```


### Usage
```ruby
ds = Deepstream::Client.new('localhost')

# Emit events
ds.emit 'my_event'
# or
ds.emit 'my_event', foo: 'bar', bar: 'foo'
# or
ds.emit 'my_event', {foo: 'bar', bar: 'foo'}, timeout: 3
# or
ds.emit 'my_event', nil, timeout: 3


# Subscribe to events
ds.on('some_event') do |msg|
  puts msg
end


# Get a record
foo = ds.get('foo')

# Get a record with a namespace (automaticly add to a list)
foo = ds.get_record('foo', list: 'bar') # record can also be accessed by ds.get('bar/foo')

# Update record
foo.bar = 'bar'
# or
foo.set('bar', 'bar')

# Set the whole record
foo.set(foo: 'foo', bar: 1)

# Get a list
foo = ds.get_list('bar')

# Add to list
foo.add('foo')

# Remove from list
foo.remove('foo')

# Show record names on the list
foo.keys

# Access records on the list
foo.all

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
deepstream-0.2.0 README.md