tart-behaving
Stability: 1 - Experimental
Behaving configuration implementation for Tiny Actor Run-Time in JavaScript that actors can send messages to.
Contributors
Overview
Behaving configuration implementation for Tiny Actor Run-Time in JavaScript that actors can send messages to.
Usage
To run the below example run:
npm run readme
"use strict"; var tart = ; var { console; this {};}; var sponsor = tart; var { var timestamp = ; this; this; message;}; var { console;}; var actor = ;var customer = ; ;
Tests
npm test
Documentation
Public API
tart.behaving([options])
options
: Object (Default: undefined) Optional overrides.behavior
: Function (Default:function (message) {}
)function (message) {}
Configuration behavior to invoke every time a message is sent to the configuration viathis.config(message)
.constructConfig
: Function (Default:function (options) {}
)function (options) {}
Configuration creation function that is givenoptions
. It should return a capabilityfunction (behavior) {}
to create new actors.deliver
: Function (Default:function (context, message, options) {}
)function (context, message, options) {}
Deliver function that returns a function fordispatch
to dispatch.dispatch
: Function (Default:setImmediate
)function (deliver) {}
Dispatch function for dispatchingdeliver
closures.fail
: Function (Default:function (exception) {}
)function (exception) {}
An optional handler to call if a sponsored actor behavior throws an exception.
Creates a sponsor capability to create new actors with and allows replacing parts of the implementation. It is implemented on top of TartJS Pluggable API.
sponsor(behavior)
Same as the core TartJS Minimal implementation. See: sponsor(behavior)
actor(message)
Same as the core TartJS Minimal implementation. See: actor(message)