jemc changed the topic of #ponylang to: Welcome! Please check out our Code of Conduct => https://github.com/ponylang/ponyc/blob/master/CODE_OF_CONDUCT.md | Public IRC logs are available => http://irclog.whitequark.org/ponylang
TwoNotes has joined #ponylang
jemc has joined #ponylang
jemc has quit [Quit: WeeChat 1.4]
jemc has joined #ponylang
TwoNotes has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
jemc has quit [Ping timeout: 246 seconds]
bb010g has quit [Quit: Connection closed for inactivity]
jemc has joined #ponylang
bb010g has joined #ponylang
graaff has joined #ponylang
graaff has quit [Quit: Leaving]
graaff has joined #ponylang
jemc has quit [Ping timeout: 244 seconds]
copy` has quit [Quit: Connection closed for inactivity]
jonrh has quit [Ping timeout: 260 seconds]
jonrh has joined #ponylang
trapped has joined #ponylang
_andre has joined #ponylang
michael_campbell has joined #ponylang
TwoNotes has joined #ponylang
lispmeister has joined #ponylang
copy` has joined #ponylang
<TwoNotes> Refactored all my TCP comm code and the program still works (always a good sign)
lispmeister has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<doublec> nice
<TwoNotes> TCPConnection uses a small 64-byte buffer, so data arrives in little chunks. I wonder how efficient that is.
Matthias247 has joined #ponylang
<sylvanc> the TCPConnection buffer size grows
<sylvanc> or at least it's supposed to :)
<sylvanc> tcpconnection.pony:376
<sylvanc> hmm, perhaps min and max buffer sizes should be constructor parameters
<TwoNotes> My observation was that the notify 'received' callback was getting 64 bytes at a time
<TwoNotes> I now use a counted message format, with a 2-byte count on each message. But I wonder how many back-and-forths it takes
<sylvanc> hmm, that could be a bug in TCPConnection
<sylvanc> too many `read` calls is definitely an efficiency problem, as you point out
juanjoc has joined #ponylang
<TwoNotes> Since there are two actors involved...
<TwoNotes> Each chunk delivered to my Notify class gets appended to a Buffer object. Pieces of that are then sent onwards via a behaviour cll to the mai nactor
<TwoNotes> I did not test this extensively. I just noticed that my longer messages were not getting delivered in one piece, so I put in the Buffering.
<TwoNotes> Perhaps the first delivered chunk is only 64, but the next one is 128 and so on.
<TwoNotes> I had a 65-byte message that broke, which is how I found it
<sylvanc> TCP messages will be fragmented in all kinds of interesting ways, in general
<sylvanc> because they are not framed by the sender
<sylvanc> so routers, switches, etc, can all fragment them
<sylvanc> or even combine them, or both
<sylvanc> so TCP generally needs application-level framing
<TwoNotes> This was between two processes on the same machine. I knew it could happen - I just not expect it to be so small
<sylvanc> in this particular case, it's because TCPConnection starts at a buf size of 64 :)
<sylvanc> so yeah, that should probably be a constructor parameter :)
<SeanTAllen> open an issue sylvanc
<TwoNotes> As long as it ramps up with 'experience' it should be OK. As you point out, TCP chunk size is unpredictable in general
<SeanTAllen> sounds like an "easy" that someone in the community could address
TwoNotes has left #ponylang [#ponylang]
TwoNotes has joined #ponylang
jemc has joined #ponylang
jemc has quit [Client Quit]
jemc has joined #ponylang
<sylvanc> done
Praetonus has joined #ponylang
juanjoc has quit [Remote host closed the connection]
amclain has joined #ponylang
bb010g has quit [Quit: Connection closed for inactivity]
<_andre> not quite battle-tested but it works in my tests :)
juanjoc has joined #ponylang
jemc has quit [Quit: WeeChat 1.4]
<TwoNotes> Yay, that's 4 DB interfaces now
<_andre> :)
jemc has joined #ponylang
jemc has quit [Ping timeout: 276 seconds]
sblessin1 is now known as sblessing
graaff has quit [Quit: Leaving]
<TwoNotes> Registrar does not return what I put in, but a Promise of it. What do I do with a Promise?
<TwoNotes> Is there some reason why the Registrar can not simply return the actor tag that I put in?
<sylvanc> TwoNotes: the Registrar is an actor, so that it can be used asynchronously by many actors
<TwoNotes> Yes, I got that part. But what is this "Promise" business?
<sylvanc> it's an asynchronous result
<sylvanc> you can attach code to it that executes on success
<sylvanc> and different code on failure
<TwoNotes> So if I try to fetch a tag "foo" but I have not put a "foo" in, I would get the failure?
<sylvanc> right!
<TwoNotes> Seems kind of a round about way to fetch the StdStream to my log file...
<sylvanc> yes, promises are definitely round-about
<sylvanc> if you have a static collection of actors, that never changes
<sylvanc> it may be simpler to pass around an immutable map, or some such
<sylvanc> the Registrar lets the mapping mutate during the life of your program
Praetonus has quit [Quit: Leaving]
<doublec> I forgot about promises. I've been passing lambda's or callback objects to my behaviours that need to return results. I should migrate to promises.
<doublec> I'm writing a wrapper for the freenet API which has a lot of "send message X, asynchronously receive a Y later" and "send Message X, asycnhronously receive multiple A, B or C messages until a D is received".
<doublec> It fits well into Pony
juanjoc has quit [Quit: Leaving]
emancu has quit []
<sylvanc> sounds good!
_andre has quit [Quit: leaving]
juanjoc has joined #ponylang
jemc has joined #ponylang
trapped has quit [Read error: Connection reset by peer]
TwoNotes has quit [Quit: Leaving.]
Praetonus has joined #ponylang
juanjoc has quit [Quit: Leaving]
Matthias247 has quit [Read error: Connection reset by peer]