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

World: r3wp

[!Uniserve] Creating Uniserve processes

Oldes
20-Jan-2009
[626x2]
In the same time it was serving MP3 from modified micro-http service 
using something like:
    on-received: func [data][
		write-client rejoin[
			{ICY 200 OK} crlf
			{icy-name: LocalRadio} crlf
			{icy-genre: whatever} crlf
			{icy-url: http://127.0.0.1:811} crlf
			{content-type: audio/mpeg} crlf
			{icy-pub: 1} crlf
			{icy-br: 128} crlf 
			crlf
		]
		write-client path-to-mp3-file
	        close-client
    ]
And running my RebolBB with responses <16ms
Steeve
20-Jan-2009
[628]
So Doc was wrong, it's unusual...
Dockimbel
20-Jan-2009
[629]
Oldes: thanks for taking the time to test it. The correct behaviour 
of WAIT is the one you've described. I'm glad you've corrected me 
on that one. I'm pretty sure that I've run such tests with different 
results when working on UniServe five years ago. Maybe something 
changed in REBOL kernel since then or maybe my test script was just 
flawed. Nice to see that there's still something to learn from R2.
Janko
20-Jan-2009
[630]
wow, audio streaming in rebol and uniserve .. cool
NickA
21-Jan-2009
[631x2]
I need to learn more about thay!
thay -> that
Oldes
21-Jan-2009
[633]
on-write is dissabled in the recent versions. Why?
Dockimbel
21-Jan-2009
[634]
What makes you think that?
Oldes
21-Jan-2009
[635x2]
; --- temporary deactivated
			;on-write port
0.9.17	21/12/2004 {
			o Added 'on-write-done event.
			o 'on-write call in 'write-peer temporaly deactivated.
			o bugfix in 'open-port, custom port-id now correctly used.
		}
Dockimbel
21-Jan-2009
[637x3]
Right, that was a workaround for a packet sending issue, but never 
had to reactivate it.
It was useful on client side to kickstart first packet sent to a 
server (kind of fast shortcut to avoid a round in event loop before 
sending the first packet), but I had more issues than benefits from 
it, so I left the code deactivated in case I would need it in future, 
but it looks like I could remove those lines. Do you have a need 
for it?
Btw, 'on-write is not disabled in UniServe, it's just no more directly 
called in that specific case.
Oldes
21-Jan-2009
[640]
probably no..  just found it as you told me, that I should control 
the data from it.
Dockimbel
21-Jan-2009
[641]
Right, controling bandwidth requires changing UniServe's internals, 
mostly in 'on-write handler.
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
[674x2]
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/