Class SharedData
source code
object --+
|
SharedData
Sometimes it is desirable to share immutable data between different
event loops, for example to implement a cache of data.
This class allows instances of shareddata data structures to be looked
up and used from different event loops. The data structures themselves
will only allow certain data types to be stored into them. This shields
the user from worrying about any thread safety issues might occur if
mutable objects were shareddata between event loops.
The following types can be stored in a shareddata data structure:
String FixNum Float Buffer - this will be automatically copied, and
the copy will be stored in the structure.
|
|
|
|
|
|
|
|
|
|
|
check_obj(obj)
Convert to corresponding Java objects and make copies where
appropriate (the underlying java map will also make copies for some
data types too) |
source code
|
|
Return a Hash with the specific name. All invocations of this method
with the same value of name are guaranteed to return the same Hash
instance.
Keyword arguments:
- Parameters:
key - Get the hash with the key.
- Returns:
- the hash.
|
Return a Set with the specific name. All invocations of this method
with the same value of name are guaranteed to return the same Set
instance.
Keyword arguments:
- Parameters:
key - Get the set with the key.
- Returns:
- the shared set.
|
Remove the hash
Keyword arguments:
- Parameters:
key - The key of the hash.
|
Remove the set
Keyword arguments:
- Parameters:
key - The key of the set.
|