CcxWrk has quit [Read error: Connection reset by peer]
CcxWrk has joined #ponylang
vaninwagen has quit [Ping timeout: 255 seconds]
dipin has quit [Quit: dipin]
gokr has quit [Ping timeout: 240 seconds]
enilsen16 has joined #ponylang
enilsen16 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bpicolo has joined #ponylang
howdopony has joined #ponylang
<howdopony>
if i wanted to wait for x messages so the actor could process them in batch for performance reasons, is there any built in way to do this? or should I just have another actor in front that collects them then passes on as a list
<SeanTAllen>
howdopony: what's the specific thing you are trying to do?
samuell has quit [Remote host closed the connection]
<howdopony>
For simulation, I want to pass a reference to the "world" to the actors, but if the world is modified in response to each actor talking to it then it's a lot of allocation for no real purpose
<howdopony>
it's fine for the view of the "world" to be a bit behind when the actor is viewing it. Ideally the "world" actor would only update itself after a specified amount of time
<howdopony>
Ideally it would "cache" messages from a certain behaviour until another behaviour had been called
<howdopony>
I was trying to avoid just having another array inside the world to do this manually, was wondering if there was any language level support for it
<howdopony>
or if i'm thinking about it the wrong way
<SeanTAllen>
there is not
<SeanTAllen>
the default batch is for an actor is to run up to 100 messages from its queue at a time
<SeanTAllen>
im a little unclear
<SeanTAllen>
why is it different to run 100 messages 1 at time all at once
<SeanTAllen>
vs
<SeanTAllen>
run 100 messages each 1 at a time at different times
<SeanTAllen>
i think i might not be understanding the problem
<howdopony>
Because in response to those messages, the world has now changed, and a new immutable reference is passed out to all the other actors. If it's going to batch 100 messages, that's 99 copies that don't have to be made
<SeanTAllen>
ah i see
<SeanTAllen>
so the other thing you can do is
<SeanTAllen>
inside your world actor
<SeanTAllen>
dont send out a new reference for every message processed
<SeanTAllen>
only do that for every X messages processed
<SeanTAllen>
or
<SeanTAllen>
you a timer that fires periodically, sends a message to the world
<SeanTAllen>
which checks to see if it has been updated since the last time it got a timer message
<SeanTAllen>
and if it has, sends out the updates
<howdopony>
Mm, that sounds fair
<SeanTAllen>
depends on if you want time based, or messages processed based