update actors

This commit is contained in:
2026-02-16 01:35:07 -06:00
parent cd6e357b6e
commit 433ce8a86e
5 changed files with 49 additions and 13 deletions

View File

@@ -231,17 +231,16 @@ function actor_die(err)
//actor_mod.on_exception(actor_die)
_cell.args = init != null ? init : {}
_cell.id = "newguy"
function create_actor(desc) {
var _desc = desc == null ? {id:guid()} : desc
var actor = {}
actor[ACTORDATA] = _desc
stone(actor)
return actor
}
var $_ = {}
$_.self = create_actor()
use_cache['core/json'] = json
@@ -734,7 +733,7 @@ stone(send)
if (!_cell.args.id) _cell.id = guid()
else _cell.id = _cell.args.id
$_.self[ACTORDATA].id = _cell.id
$_.self = create_actor({id: _cell.id})
// Actor's timeslice for processing a single message
function turn(msg)
@@ -839,12 +838,8 @@ function handle_message(msg) {
if (msg.type == "user") {
letter = msg.data // what the sender really sent
_ObjectDefineProperty(letter, HEADER, {
value: msg, enumerable: false
})
_ObjectDefineProperty(letter, ACTORDATA, { // this is so is_actor == true
value: { reply: msg.reply }, enumerable: false
})
letter[HEADER] = msg
letter[ACTORDATA] = { reply: msg.reply }
if (msg.return) {
fn = replies[msg.return]