tag:blogger.com,1999:blog-37596622.post1095216931888961917..comments2023-10-03T08:01:27.038-07:00Comments on The Awesome Factor: A new library to manage client connections, and a proof of concept chat server in FactorDoug Colemanhttp://www.blogger.com/profile/09416611825627835802noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-37596622.post-45364614557784159032021-08-01T06:45:59.996-07:002021-08-01T06:45:59.996-07:00Keto Advanced Fat Burner moved at breakneck speed....<br />Keto Advanced Fat Burner moved at breakneck speed. That was my Keto Advanced Fat Burner plan at the time this happened. I know that you will have trouble finding an inexpensive source for Keto Advanced Fat Burner is that it details more Keto Advanced Fat Burner.<br /><br /><a href="https://www.ketoadvancedfatburner.cc/" rel="nofollow">Keto Advanced Fat Burner</a> Candyce Herrhttps://www.blogger.com/profile/01057660293926803000noreply@blogger.comtag:blogger.com,1999:blog-37596622.post-32921573660346501702020-01-14T03:56:08.842-08:002020-01-14T03:56:08.842-08:00Male Perf Avis
Site officiel (Magasinez maintenan...<a href="https://www.dietarycafe.com/male-perf-avis-fr/" rel="nofollow">Male Perf Avis</a><br /><br />Site officiel (Magasinez maintenant) :- <a href="https://www.dietarycafe.com/male-perf-avis-fr/" rel="nofollow">https://www.dietarycafe.com/male-perf-avis-fr/</a><br /><br />Visitez maintenant plus d'informations:-<br /><br /><a href="http://dietarycafe.mystrikingly.com/blog/male-perf" rel="nofollow">http://dietarycafe.mystrikingly.com/blog/male-perf</a><br /><br /><a href="https://www.completefoods.co/diy/recipes/male-perf-acheter" rel="nofollow">https://www.completefoods.co/diy/recipes/male-perf-acheter</a><br /><br /><a href="https://sites.google.com/site/dietarycafe/male-perf" rel="nofollow">https://sites.google.com/site/dietarycafe/male-perf</a><br /><br /><a href="https://medium.com/@dietarycafe/male-perf-d67c9f8eb876" rel="nofollow">https://medium.com/@dietarycafe/male-perf-d67c9f8eb876</a><br /><br /><a href="https://dietarycafe.blogspot.com/2020/01/male-perf.html" rel="nofollow">https://dietarycafe.blogspot.com/2020/01/male-perf.html</a><br /><br /><a href="http://thedietarycafe.over-blog.com/male-perf" rel="nofollow">http://thedietarycafe.over-blog.com/male-perf</a><br /><br /><a href="https://dietarycafe.wixsite.com/mysite/post/male-perf-avis" rel="nofollow">https://dietarycafe.wixsite.com/mysite/post/male-perf-avis</a><br /><br /><a href="https://www.dietarycafe.com/crazybulk-avis-fr/" rel="nofollow">https://www.dietarycafe.com/crazybulk-avis-fr/</a><br /><br />Male Perf est la formule puissante conçue en gardant à l'esprit les besoins uniques des mâles. <br />Dietary Cafehttps://www.blogger.com/profile/14754749111070865498noreply@blogger.comtag:blogger.com,1999:blog-37596622.post-87725722367557414902009-06-02T11:50:16.310-07:002009-06-02T11:50:16.310-07:00I'm really glad to see you meant live coding the w...I'm really glad to see you meant live coding the way I hoped you meant it.<br /><br />I'm hoping for a day where there's a Firefox based ui listener that I can hook up to running factor instances on my servers. (Maybe with some ssh tunneling or whatever.)<br /><br />Anyway, very cool. Glad you wrote that up.Darrin Thompsonhttps://www.blogger.com/profile/04037462028265507114noreply@blogger.comtag:blogger.com,1999:blog-37596622.post-65086643220254938652009-06-02T11:02:48.288-07:002009-06-02T11:02:48.288-07:00By live coding on the server I meant that I could ...By live coding on the server I meant that I could add features without restarting Factor or disconnecting anyone. I had Factor running in a terminal with the chat server running in the in-thread combinator (so I could still type) and another terminal was connected so I could chat/test. Restructuring the server command handling caused me to have to restart because I got the code wrong at first but after adding /who and /time you could do a /help and see the new commands.<br /><br />So the workflow was: run the server in-thread, edit files, refresh-all, and test without restarting. Sorry I didn't make this more clear in the blog post -- blogging about code with Blogger really sucks because I get bogged down formatting everything for whitespace and escaping html elements instead of writing actual content.Doug Colemanhttps://www.blogger.com/profile/09416611825627835802noreply@blogger.comtag:blogger.com,1999:blog-37596622.post-4517613063401616512009-06-02T08:31:06.200-07:002009-06-02T08:31:06.200-07:00Can you elaborate a bit on what you meant by "live...Can you elaborate a bit on what you meant by "live coding on the server"? Was it that you changed the case statement to something more dynamic without restarting? Was your listener ui running on a different machine from your server? Can I have a pony?Darrin Thompsonhttps://www.blogger.com/profile/04037462028265507114noreply@blogger.comtag:blogger.com,1999:blog-37596622.post-67074648247770394552009-06-01T07:41:10.092-07:002009-06-01T07:41:10.092-07:00Lines 69,125 of io.server.connections sets the soc...Lines 69,125 of io.server.connections sets the socket addresses and the threaded-server. <br />Lines 75, 82 in managed-server sets the managed-client/server.<br /><br />Each client gets its own scope because the with-stream combinator (called in handle-client in io.server.connectin) creates a new namespace (a new hashtable on the namestack).Doug Colemanhttps://www.blogger.com/profile/09416611825627835802noreply@blogger.comtag:blogger.com,1999:blog-37596622.post-10479412609639801322009-06-01T05:54:52.656-07:002009-06-01T05:54:52.656-07:00Yes, indeed it is very readable.
I haven't (yet) u...Yes, indeed it is very readable.<br />I haven't (yet) used this technique - I believe it can simplify and give an easier approach when programming. Still I'm wondering how it works. that is, how does the chat server know not to confuse between the different clients.<br />I browsed the managed-server code in git, but didn't see where the binding is happening. can you point me to that line, please?<br />I think these parts are needed in mine or other users' understanding in order to create new servers.<br />Again that was a very nice explanation, and I love these great abstractions, they make new things accelerate based on them. I like it when the code is so simple, and the promise of bugless code is again shown :)randy7https://www.blogger.com/profile/14165440531808419435noreply@blogger.comtag:blogger.com,1999:blog-37596622.post-55252961496592164632009-05-31T19:55:19.749-07:002009-05-31T19:55:19.749-07:00Since threaded-server binds a lot of variables to ...Since threaded-server binds a lot of variables to your local namespace, I used this approach and made some helper words in managed-server:<br /><br />: server ( -- managed-client ) managed-server get ;<br />: client ( -- managed-client ) managed-client get ;<br />: clients ( -- assoc ) server clients>> ;<br />: client-streams ( -- assoc ) clients values ;<br />: username ( -- string ) client username>> ;<br />: everyone-else ( -- assoc )<br /> clients [ drop username = not ] assoc-filter ;<br />: everyone-else-streams ( -- assoc ) everyone-else values ;<br /><br />You can see which symbols are set by the server: managed-server, managed-client. It really helps for readability and the code would look too long and repetitive without these helper words. So the snippet of code you posted sets the quit slot on the client in the current scope when readln returns f, meaning end of stream. The current scope has the client you're talking to immediately and the server, and the other clients are accessed through the server symbol-- this is done by managed-server and works really well. Another approach would be to pass around a tuple with all the state, but this makes stack shuffling harder.Doug Colemanhttps://www.blogger.com/profile/09416611825627835802noreply@blogger.comtag:blogger.com,1999:blog-37596622.post-59156409245564489772009-05-31T14:40:16.516-07:002009-05-31T14:40:16.516-07:00Hi Doug, very clear and very cool.
There is one t...Hi Doug, very clear and very cool.<br /><br />There is one thing, if you care to explain:<br />M: chat-server handle-managed-client*<br /> readln dup f = [ t client (>>quit?) ] when<br /><br />I am guessing the client is a symbol that contains the user tuple, bounded to the client's connection?<br /><br />can you explain this concept of binding. how to use and how does it work. Thanksrandy7https://www.blogger.com/profile/14165440531808419435noreply@blogger.com