Monday, November 08, 2010 at 12:06 AM.

system.verbs.builtins.tcp.examples.manyThreads

<<local (domain = "ws3.scripting.com")
<<local (adroutline = @system.verbs.builtins.tcp.examples.scriptingPaths)
local (domain = "www.biap.com");
local (adroutline = @system.verbs.builtins.tcp.examples.biapPaths);
local (adrlist = {});
bundle {
	target.set (adroutline);
	op.firstsummit ();
	loop {
		adrlist = adrlist + op.getlinetext ();
		if not op.go (down, 1) {
			break}};
	target.clear ()};
local (i);
for i = 1 to 10 {
	local (ct=0);
	if not defined (scratchpad.pages) {
		new (tabletype, @scratchpad.pages)};
	edit (@scratchpad.pages);
	for item in adrlist {
		thread.easyCall ("tcp.examples.oneThread", {domain, item, "scratchpad.pages.page" + ct});
		ct++;
		if mod (ct, 3) == 0 {
			thread.sleepFor (1)}};
	filemenu.save ();
	thread.sleepFor (5);
	while Frontier.countThreads () > 2 {
		window.msg (clock.now ());
		thread.sleepFor (1)}}



This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.