Actor component of SUGOS.
- Functions
SugoActor
Class
Create an actor instance. Just an alias of new SugoActor(config)
Param | Type | Description |
---|---|---|
config | Object | Sugo caller configuration |
Example:
co(function * () {
let actor = sugoActor({
key: 'my-actor-01',
modules: {
}
})
yield actor.connect()
}).catch((err) => console.error(err))
Extends:
SugoClient
Constructor of SugoActor class
Param | Type | Description |
---|---|---|
url | string | Cloud server url |
config | object | Configurations |
config.key | string | Key of actor |
config.auth | object | Auth object |
config.modules | object.<String, SugoActorModule> | Modules to load. |
config.path | string | Socket.IO option. |
Connect to hub. By call this, actor share specification of the modules to hub so that callers can access them.
Disconnect from the hub
Handle perform event
Param | Type | Description |
---|---|---|
data | object |
Load a module
Param | Type | Description |
---|---|---|
moduleName | string | Name of module |
module | Object | Module to load |
Load sub modules
Param | Type | Description |
---|---|---|
moduleName | string | |
subModules | Object |
Unload a module
Param | Type | Description |
---|---|---|
moduleName | string | Name of module |
Unload sub module
Param | Type | Description |
---|---|---|
moduleName | string | Name of module |
subModuleNames | Array.<string> | Name of sub modules |
Assert if the connected to hub
Parse actor url