Skip to content

Commit

Permalink
addded documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdanRada committed Sep 19, 2016
1 parent f83f573 commit 312bf60
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 6 deletions.
5 changes: 3 additions & 2 deletions celluloid_pubsub.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ Gem::Specification.new do |s|

s.licenses = ['MIT']
s.files = `git ls-files`.split("\n")
s.test_files = s.files.grep(/^(spec)/)
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split('\n').map{ |f| File.basename(f) }
s.require_paths = ['lib']

s.add_runtime_dependency 'celluloid', '>= 0.16', '>= 0.16.0'
s.add_runtime_dependency 'celluloid-io', '>= 0.16', '>= 0.16.2'
s.add_runtime_dependency 'reel', '~> 0.6', '>= 0.6.0'
Expand Down
13 changes: 12 additions & 1 deletion lib/celluloid_pubsub/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,18 @@ module CelluloidPubsub
class Client
include CelluloidPubsub::BaseActor

attr_accessor :actor, :options, :channel
# The actor that made the connection
# @return [Celluloid::Actor] actor to which callbacks will be delegated to
attr_accessor :actor

# options that can be used to connect to webser and send additional data
# @return [Hash] the options that can be used to connect to webser and send additional data
attr_accessor :options

# The channel to which the client will subscribe to once the connection is open
# @return [String] The channel to which the client will subscribe to
attr_accessor :channel

finalizer :shutdown
# receives a list of options that are used to connect to the webserver and an actor to which the callbacks are delegated to
# when receiving messages from a channel
Expand Down
13 changes: 12 additions & 1 deletion lib/celluloid_pubsub/reactor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,18 @@ module CelluloidPubsub
class Reactor
include CelluloidPubsub::BaseActor

attr_accessor :websocket, :server, :channels
# The websocket connection received from the server
# @return [Reel::WebSocket] websocket connection
attr_accessor :websocket

# The server instance to which this reactor is linked to
# @return [CelluloidPubsub::Webserver] the server actor to which the reactor is connected to
attr_accessor :server

# The channels to which this reactor has subscribed to
# @return [Array] array of channels to which the current reactor has subscribed to
attr_accessor :channels

finalizer :shutdown
# rececives a new socket connection from the server
# and listens for messages
Expand Down
6 changes: 4 additions & 2 deletions lib/celluloid_pubsub/registry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
# frozen_string_literal: true
module CelluloidPubsub
# class used to register new channels and save them in memory
# @!attribute channels
# @return [Array] array of channels to which actors have subscribed to
class Registry
class << self
# @!attribute channels
# @return [Array] array of channels to which actors have subscribed to
# The channels that the server can handle
# @return [Array] array of channels to which actors have subscribed to
attr_accessor :channels
end
@channels = []
Expand Down

0 comments on commit 312bf60

Please sign in to comment.