I've to write a class opening remote session, and I wonder if it is
possible to write it such a way that ensure a closing session ?
say I've a class :
class Toto
def self.open
// do the job to open a session
end
def self.getSomething
return something
end
def self.close
// close the session
end
end
I'd like to have Toto.close automatically called when no more method
used (it supposes a certain amount of time ?)
I do not think it is wise to use class methods for that. I'd rather
create an instance for that - even if it is a singleton or assigned to a global variable.
I'd like to have Toto.close automatically called when no more method
used (it supposes a certain amount of time ?)
http://ruby-doc.org/stdlib-2.4.1/libdoc/timeout/rdoc/index.html
Cheers
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 69:19:10 |
Calls: | 6,655 |
Calls today: | 1 |
Files: | 12,200 |
Messages: | 5,332,099 |
Posted today: | 1 |