Changeset 14954 for misc/runpugs
- Timestamp:
- 12/30/06 19:07:12 (23 months ago)
- Location:
- misc/runpugs
- Files:
-
- 2 added
- 8 modified
-
cgi-bin/runp6script (added)
-
cgi-bin/runpugs2 (modified) (1 diff)
-
data/runp6script.html (added)
-
data/runpugs.html (modified) (1 diff)
-
htdocs/index.html (modified) (3 diffs)
-
htdocs/runpugs.css (modified) (1 diff)
-
htdocs/runpugs/index.html (modified) (2 diffs)
-
lib/Web/Terminal/Server3.pm (modified) (6 diffs)
-
lib/Web/Terminal/Settings.pm (modified) (1 diff)
-
perl/runpugs3.pl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
misc/runpugs/cgi-bin/runpugs2
r14733 r14954 23 23 use Web::Terminal::Settings; 24 24 use Web::Terminal::Dispatcher; 25 $Web::Terminal::Settings::port=2058;25 #$Web::Terminal::Settings::port=2058; 26 26 #push (@INC, "$wwwpath$htmlpath$project"); 27 27 -
misc/runpugs/data/runpugs.html
r14885 r14954 168 168 href="http://feather.perl6.nl/~andara/runpugs/">read the documentation</a>. 169 169 </p> 170 <p class="copyright">© Copyright 2006 by Wim Vanderbauwhede</p> 170 <p class="copyright">© Copyright 2006 by Wim.Vanderbauwhede. Contact me 171 at gmail.com.</p> 171 172 </div> 172 173 </body> -
misc/runpugs/htdocs/index.html
r14851 r14954 4 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 5 5 <title>Run Perl 6 Now -- in your browser!</title> 6 <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> 7 <link rel="icon" href="favicon.ico" type="image/x-icon"> 6 8 <link rel="stylesheet" type="text/css" href="runpugs.css"> 7 9 </head> … … 20 22 <tt>runpugs</tt>:</p><ul><li>try the <a 21 23 href="http://feather.perl6.nl:8080/runpugs/">interactive session</a> 22 with <em>command history</em></li> <li>or <a 23 href="http://feather.perl6.nl:8080/cgi-bin/runpugs2?ia=0">run a full Perl 6 24 script</a> in <em>non-interactive</em> mode.</li></ul> 24 with command history, fast startup and response and a persistent interface; </li> 25 <li>or <a 26 href="http://feather.perl6.nl:8080/cgi-bin/runp6script">run a full Perl 6 27 script</a> in <em>non-interactive</em> mode.</li> 28 29 </ul> 25 30 26 31 <h2>Instructions</h2> … … 74 79 <code><a href="http://svn.pugscode.org/pugs/misc/runpugs">/misc/runpugs</a></code>. 75 80 <p>Thank you for trying <tt>pugs</tt> and <tt>runpugs</tt>!</p> 76 <p class="copyright">© Copyright 2006 by Wim Vanderbauwhede</p> 81 <p class="copyright">© Copyright 2006 by Wim.Vanderbauwhede. Contact me 82 at gmail.com</p> 77 83 </div> 78 84 </body></html> -
misc/runpugs/htdocs/runpugs.css
r14743 r14954 76 76 } 77 77 #outputwindow { 78 height: 20ex;78 height:40ex; 79 79 } 80 80 #editorwindow { -
misc/runpugs/htdocs/runpugs/index.html
r14930 r14954 16 16 <input name="ia" value="1" type="hidden"> 17 17 <input name="action" value="runpugs" type="hidden"> 18 <input id="rel" value="0" name="reldev" checked="checked"type="radio"18 <input id="rel" value="0" name="reldev" type="radio" 19 19 onClick="set_version()"><label for="rel">Release version</label> 20 <input id="dev" value="1" name="reldev" type="radio" onClick="set_version()"><label for="dev">Development version</label>20 <input id="dev" value="1" name="reldev" checked="checked" type="radio" onClick="set_version()"><label for="dev">Development version</label> 21 21 <div id="termwindow"> 22 22 <textarea id="cmd" name="cmd" rows="20" cols="80" wrap="virtual" … … 31 31 <p>This live web terminal runs the <a href="http://www.pugscode.org/">Pugs</a> 32 32 interpreter for <a href="http://dev.perl.org/perl%206/">Perl 6</a>. 33 <p>This is the development version, featuring asynchronous JavaScript, 34 mod_perl and preloaded pugs sessions.</p> 33 35 Please <a href="http://feather.perl6.nl/%7Eandara/runpugs/">read the documentation</a>. 34 36 </p> 35 <p class="copyright">© Copyright 2006 by Wim Vanderbauwhede</p>37 <p class="copyright">© Copyright 2006 by Wim.Vanderbauwhede. Contact me @ gmail.com<./p> 36 38 </div> 37 39 </body></html> -
misc/runpugs/lib/Web/Terminal/Server3.pm
r14930 r14954 35 35 #our $session_counter = 0; 36 36 my %sessions = (); # holds the session objects 37 my @sessions_stack = 1 .. $Web::Terminal::Settings::nsessions; 38 my @sessions_stack_app = (); 37 my @sessions_stack = 1 .. $Web::Terminal::Settings::nsessions; # holds counters for new sessions 38 my @sessions_stack_app = (); # holds counters for idle sessions per app 39 39 my $v = 1 - $Web::Terminal::Settings::daemon; 40 40 … … 188 188 my $ia = shift; 189 189 my $cmd = shift; 190 if($ia!=0) { 190 191 if ( scalar( keys %terminals ) > $Web::Terminal::Settings::nsessions 191 192 or scalar(@sessions_stack) == 0 ) … … 270 271 # Every time a free session is taken, create a new session 271 272 # if the number of free sessions is low 272 if ( @{ $sessions_stack_app[$app] } <2) {273 if ( @{ $sessions_stack_app[$app] } < $Web::Terminal::Settings::npreloaded_sessions[$app]-1) { 273 274 # we use a SIGUSR2 to the child for this 274 275 kill 'USR2', $pid or die $!; … … 291 292 } 292 293 } 294 } else { # non-interactive 295 print "Non-interactive $id\n" if $v; 296 print "$app $ia $id $cmd\n" if $v; 297 my $term = new 298 Web::Terminal::Server::Session(app=>$app,ia=>$ia,id=>$id,cmds=>$cmd); 299 $term->{called}=time; 300 $term->{ip}=$ip; 301 my $output= $term->{'output'}; 302 $term->DESTROY(); 303 return $output; 304 } 293 305 } # of termhandler 294 306 … … 344 356 345 357 sub timeout() { 346 my $now = time(); 358 # Cleaning up timed-out sessions 359 my $now = time(); 347 360 for my $id ( keys %terminals ) { 348 361 if ( exists $terminals{$id} ) { … … 361 374 } 362 375 } 376 # Keep the number of preloaded sessions low 377 # There is no reason to have more than npreloaded_sessions sessions preloaded and idle 378 #Clean up the @sessions_stack_app for each $app: 379 380 for my $app ( 0 .. @Web::Terminal::Settings::commands - 1 ) { 381 while(@{ $sessions_stack_app[$app] } > 382 $Web::Terminal::Settings::npreloaded_sessions[$app]+1){ 383 my $idle_session_counter=shift @{ $sessions_stack_app[$app] }; 384 # now actally kill that session! 385 push @sessions_stack, $idle_session_counter; 386 $sessions{$idle_session_counter}->DESTROY(); 387 delete $sessions{$idle_session_counter}; 388 } 389 } 363 390 } 364 391 -
misc/runpugs/lib/Web/Terminal/Settings.pm
r14930 r14954 76 76 our $tmp_path='/home/andara/apache/data/tmp/'; 77 77 our $log_path='/home/andara/apache/data/log/'; 78 our $daemon= 0;78 our $daemon=1; 79 79 our $port=2057; 80 80 our $host='localhost'; -
misc/runpugs/perl/runpugs3.pl
r14930 r14954 98 98 my $sessionid=shift; 99 99 my $ip=shift; 100 my $dev=$query->param('reldev')||0; 101 $dev=$dev*1; 100 my $dev=$query->param('reldev');#||0; 101 if ($dev!=0){ 102 $dev=1; 103 } 102 104 my $devc='checked'; 103 105 my $relc='';
