Class: TTK::Fetchers::Server
- Includes:
- DRb::DRbUndumped
- Defined in:
- lib/ttk/fetchers/Server.rb,
lib/ttk/fetchers/server/sender.rb
Defined Under Namespace
Classes: Sender
Instance Attribute Summary collapse
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
Instance Method Summary collapse
- #fetch(resource, recv) ⇒ Object
-
#initialize(service, repository) ⇒ Server
constructor
A new instance of Server.
- #resources_sent ⇒ Object
- #uri ⇒ Object
Constructor Details
#initialize(service, repository) ⇒ Server
Returns a new instance of Server.
17 18 19 20 21 22 |
# File 'lib/ttk/fetchers/Server.rb', line 17 def initialize(service, repository) @service = service @repository = repository @resources_sent = [] @mutex = Mutex.new end |
Instance Attribute Details
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
24 25 26 |
# File 'lib/ttk/fetchers/Server.rb', line 24 def repository @repository end |
Instance Method Details
#fetch(resource, recv) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/ttk/fetchers/Server.rb', line 30 def fetch(resource, recv) sender = Sender.new(@repository + resource, recv) @mutex.synchronize { @resources_sent << sender } sender.send sender.stat end |
#resources_sent ⇒ Object
26 27 28 |
# File 'lib/ttk/fetchers/Server.rb', line 26 def resources_sent @mutex.synchronize { @resources_sent.dup } end |
#uri ⇒ Object
37 38 39 |
# File 'lib/ttk/fetchers/Server.rb', line 37 def uri @service.uri end |