[comp.lang.objective-c] Objects invoking methods on objects

rmyers@ics.uci.edu (Richard E. Myers) (10/04/90)

I am trying to create an object that invokes methods on other objects
inorder of some arbitrary delay and not inorder of when they were
queued.  The "method queue" system I'm looking for would work
something like the following.

The code sequence:

 ----------------------------------------------------------------------------
	// Set the methods, targets and method arguments
	method2Q = RESIZE;
	target1 = ACUBE#1;
	target2 = ACUBE#2;
	args2Q = "3,10,20,30";

	aQ = [PriorityQ new];

	// Queue the methods
	// [aQ sel:<method> to:<object> withDelay:<delay> argCount:<arg list>]
	[aQ sel: method2Q to: target1 withDelay: 10 argCount: args2Q];
  	[aQ sel: method2Q to: target2 withDelay:  9 argCount: args2Q];
	
	// Run the Queue
	[aQ run];
 ----------------------------------------------------------------------------

Would cause the method "RESIZE" to be invoked first on the object
target2 and then on target1.  Target objects should also be able to
queue methods while the queue is running.

I'd love to get a look at how NeXT did this with their Conductor class
from the Music Kit.  Is source available for the NeXT application
kits?  If not, does anyone know of another class that operates similar
to what I've outlined above and for which source code *is* available?

Thanks for you help,

  -- Richard
-- 
-------------------------------------------------------------------------------
 "Programs were devised whose `thinking' was to human thinking as a
 slinky flipping end over end down a staircase is to human locomotion."
							-- D.R. Hoffstadter