Sha256: 19e4789028c584767bf38d38043a113f5aea0f912383a8bd600f432d77ac399d

Contents?: true

Size: 900 Bytes

Versions: 5

Compression:

Stored size: 900 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

5 entries across 5 versions & 1 rubygems

Version Path
deepstream-0.1.7 README.md
deepstream-0.1.6 README.md
deepstream-0.1.5 README.md
deepstream-0.1.4 README.md
deepstream-0.1.3 README.md