Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F461499
client.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, May 18, 1:31 AM
Size
697 B
Mime Type
text/x-ruby
Expires
Tue, May 20, 1:31 AM (1 d, 6 h)
Engine
blob
Format
Raw Data
Handle
220294
Attached To
rARCHIVING archiving
client.rb
View Options
module
Bean
class
Client
def
initialize
(
host
)
@host
=
host
end
def
put
(
body
)
client
.
tubes
[
'default'
].
put
(
body
)
rescue
Beaneater
::
NotConnected
reconnect!
end
def
reserve
(
*
args
)
client
.
tubes
.
reserve
(
*
args
)
end
def
reconnect!
(
retries
=
3
,
sleep_time
=
0
.
5
)
client!
rescue
Beaneater
::
NotConnected
=>
exception
retries
-=
1
raise
exception
if
retries
.
zero?
sleep
(
sleep_time
)
retry
end
private
def
client
@client
||=
client!
end
def
client!
@client
.
close
if
@client
# rescue nil
@client
=
connect
end
def
connect
Beaneater
.
new
(
@host
)
end
end
end
Event Timeline
Log In to Comment