r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!Uniserve] Creating Uniserve processes

Maarten
19-Feb-2009
[642x2]
The balloon goes up! I want to move Rugby's transport layer to Uniserve, 
or even better, Cheyenne. (http tunneling). For this to really work 
I only need to know if you have primitives for timers in the event 
loop (inside the 'wait): do-every time! [ code ]  do-after time! 
[code]
The rest will be porting transport and state machines on the server, 
but as Rugby already had a CGI interface it hould be simle to use 
the server with Cheyenne.
Dockimbel
19-Feb-2009
[644]
That feature is waiting for weeks to be implemented (need it for 
adding a mail relay agent to Cheyenne and for cron-like jobs scheduling), 
I'll give it some time this weekend.
Graham
19-Feb-2009
[645]
Is this convergence ?  :)
Maarten
20-Feb-2009
[646]
No, this will be world domination ;-)
Pekr
20-Feb-2009
[647x3]
Rugby to the rescue! I always wanted general multiplexing architecture 
being part of REBOL natively, but then I also wanted simplicity of 
Rugby. Now I will get both? :-)
Maarten - what about Chord concept, is it still valid? Or is there 
anything better out there worth implementing?
btw - what is missing in R3 to start porting of Uniserve to R3? Higher 
level protocols? Or tasks?
Dockimbel
20-Feb-2009
[650]
Stability maybe? ;-)
Maarten
21-Feb-2009
[651x2]
First ugby on Uniserve. Then Chord on top of that.... Chord on Rugby 
is already working.
Nenad, this may help you: http://www.colellachiara.com/soft/Libs/timers.r
Janko
21-Feb-2009
[653]
Chord.. is this that discributted hash table or something else?
Maarten
21-Feb-2009
[654]
yes
Janko
21-Feb-2009
[655x2]
hm.. interesting.. is there any more info about it on web somewher? 
( btw: I remember I played with Rugby 8-10 years ago when I was allround 
programming newbie, it looked like total magic to me)
aha, I found this http://www.colellachiara.com/soft/Libs/chord.r
Maarten
21-Feb-2009
[657]
Yes, but that's not working - someting with async ports. I have something 
on top of Rugby that works, but it's too slow.
Graham
26-May-2009
[658x2]
Has anyone written a IRC server in Uniserve?
( this group is not supposed to be private - made public )
Janko
20-Nov-2009
[660]
I was looking at uniserve today .. really nicely made .. especially 
if you know that uniserve is running cheyenne which runs so fast 
and well .. I will port my distibuted actors library to use uniserve
Will
20-Nov-2009
[661]
What is distributed actors library? sounds interesting 8)
Barik
13-Jan-2010
[662x2]
If I have a Uniserve service that I've created, and two clients (say, 
A and B) connect to this service, how can I have A send a message 
to B?
Basically, I need a way to do client to client communications with 
Uniserve, much like say a chat server.
Dockimbel
13-Jan-2010
[664]
In your Uniserve service, build a list of ports with every client 
connecting (on-new-client event). When required, walk through the 
list of ports and broadcast whatever you want to the selected ones 
(or everyone). See this Chat application server-side source as an 
example of how to achieve that (it's not an Uniserve service, but 
it's very close anyway) : http://cheyenne-server.googlecode.com/svn/trunk/Cheyenne/www/ws-apps/chat.r


The resulting chat application is here : http://demo.cheyenne-server.org:8080/chat.html
Janko
29-Jan-2010
[665x2]
One question Doc , I know you invested a tons of time info figuring 
out all thinks needed to make async sockets with rebol work so well, 
but..  did you ever consider using something like libevent ( http://www.monkey.org/~provos/libevent/
) or libev ( http://software.schmorp.de/pkg/libev.html) . These 
libraries are very popular with embeding in many languages ( and 
show outstanding benchmarks ) last few years after the C10K problem 
was formulated ( http://www.kegel.com/c10k.html)
I am asking just out of curiosity and because it could mean aditional 
benefits for uniserve (which I am looking to use for sometihng now) 
and by that of course also cheyenne
Pekr
29-Jan-2010
[667]
Libevent were suggested for R3, to be incorporated, but Carl said, 
that event model was rewritten for R3, and that it is really good. 
IMO Uniserve is relying on R2 even mechanism, I am not sure how it 
could use libevent instead? But that is for gurus to consider ..
Dockimbel
29-Jan-2010
[668]
I'm aware of libevent. Wrapping such lib in R2 would mean, at least, 
giving up on REBOL ports and REBOL's event loop. Quite a huge price 
to pay (UniServe couldn't be used with View apps, nor could receive 
system:// port events anymore). There's also the need to call REBOL 
function from the C side, which is not well supported in R2 (not 
even in R3...yet).
Janko
29-Jan-2010
[669x2]
I also don't know. I suppose it would mean to change the rebol event/async 
handling with this. I know this would be a huge decision so I am 
not expecting any answer or anything.. just wanted to put into discussion
Aha .. cool ..
Dockimbel
29-Jan-2010
[671]
It should be possible to integrate it in R3 by rewriting the network 
part of the host kit (if both licenses are compatible).
Janko
29-Jan-2010
[672]
while I am throwing in these libraries .. have you heard for mongrel 
http parser ?
Dockimbel
29-Jan-2010
[673]
I've heard of Mongrel server. What's special with its http parser?
Janko
29-Jan-2010
[674x3]
mongrel is a server for ruby .. but it has a open sourced http parser 
that is written in "ragel" which is engine that makes some fast and 
lightweigh C code out of state machine specification. it's known 
as to be very fast and very robust because of that ( I listened too 
much online video talks in my life ) ... I will try to find some 
links
http://www.complang.org/ragel/
http://www.zedshaw.com/essays/ragel_state_charts.html
Dockimbel
29-Jan-2010
[677]
Ah, thanks for the info, I'll check the parsing rules used (that's 
a real PIA to get it right *and* secure). For the speed concern, 
a PARSE-based solution shouldn't be much slower than a C parser.
Janko
29-Jan-2010
[678x4]
http://vision-media.ca/resources/misc/ragel-examples-- look here 
.. maybe this is the specification find "Mongrel HTTP 1/1"
ha , this is similar as more advanced rebol parse :)
I mean more advanced usage of rebol's parse
yes, I imagine http to get fully officially right is a major pain
Dockimbel
29-Jan-2010
[682]
At first look, Ragel relies on callbacks on matched patterns, so 
not a good fit for R2.
Janko
29-Jan-2010
[683x4]
aja.. didn't look that far .. I thougth it parses given input and 
gives some result , but because result is complex callbacks might 
be nevesarry ..
**if** you found it's worth it you could make callbacks in c .. collect 
the result and only return it to rebol as data
but for the starters it requieres worka and time to discover if it's 
even worth it
I saw some huge graph one time as "whole HTTP spec" .. it was huge, 
and worying how complex it looked .. I will try to find it
Pekr
29-Jan-2010
[687]
I think that parse is powerfull enough to handle such parsing task. 
But finding common patterns out there might be helpful ...
Janko
29-Jan-2010
[688x4]
Yes, surely parse can do it... I am just debating .. I am not sure 
if mongrell is really that awesome.


I was thinking that speedwise the upper bound of the http server 
is determined by socket handling and http parsing probably? Meaning 
that even if you have everything in ram and prepared you can't serve 
more thatn that. Cheyenne has a *very* high upper bound for a dynamic 
language (I was many times expressing my surprise and getting 250 
req/s was the reason I returned back to rebol with doing all webapps 
in it now).
for example of mongrell .. you typically run multiple (like 5) mongrell 
servers with ruby behind a nginx.. cheyenne does all this by itself 
so cheyenne also uses multicore /cpu better than other dyn lang servers 
by default. I am just thinking outloud if there are any prospects 
to make cheyenne/uniserve even more blazing if needed in future.
this is manually improved ragel generated http parser http://four.livejournal.com/1033160.html
uses callbacks too