Static functions for interacting with cluster objects
Myna uses Hazelcast http://www.hazelcast.com for clustering. These functions grant access to the underlying Hazelcast structures.
Myna automatically clusters based on a shared “myna_permissions: datasource. However, you often want to limit messages/structures to instances that share the same purpose, so these functions limit scope by purpose and instance id by default. This is done by appending “|purpose=,instance_id=” to resource names.
Hazelcast “Topics” are implemented in Myna.Event and work a little differently
See Also
| Myna. Cluster | Static functions for interacting with cluster objects |
| Functions | |
| getMap | returns a Hazelcast map object |
| getList | returns a Hazelcast list object |
| getQueue | returns a Hazelcast queue object |
Myna.Cluster.getMap = function( name, instance, purpose )
returns a Hazelcast map object
| name | name of the map |
| instance | Optional, default $server.instanceId This map will be limited to the specified instance id. This is useful when you have identical instances running on multiple servers and want to share data. Set to “ANY” to enable all instances |
| purpose | Optional, default $server.purpose This map will be limited to the specified purpose. Set to “ANY” to enable all purposes |
The returned object is an implementation of java.util.concurrent.ConcurrentMap
Myna.Cluster.getList = function( name, instance, purpose )
returns a Hazelcast list object
| name | name of the list |
| instance | Optional, default $server.instanceId This list will be limited to the specified instance id. This is useful when you have identical instances running on multiple servers and want to share data. Set to “ANY” to enable all instances |
| purpose | Optional, default $server.purpose This list will be limited to the specified purpose. Set to “ANY” to enable all purposes |
The returned object is an implementation of java.util.List
Myna.Cluster.getQueue = function( name, instance, purpose )
returns a Hazelcast queue object
| name | name of the queue |
| instance | Optional, default $server.instanceId This queue will be limited to the specified instance id. This is useful when you have identical instances running on multiple servers and want to share data. Set to “ANY” to enable all instances |
| purpose | Optional, default $server.purpose This queue will be limited to the specified purpose. Set to “ANY” to enable all purposes |
The returned object is an implementation of java.util.concurrent.BlockingQueue
returns a Hazelcast map object
Myna.Cluster.getMap = function( name, instance, purpose )
returns a Hazelcast list object
Myna.Cluster.getList = function( name, instance, purpose )
returns a Hazelcast queue object
Myna.Cluster.getQueue = function( name, instance, purpose )