I'm attempting to utilize Android as a multi user system. So I'm trying to wrap my head around queuing without going through 4 yrs of compsci.
Having "4 yrs of compsci" would be a reasonable idea for anyone looking to rewrite portions of the operating system, as you appear to wish to do.
What exactly is a command queue, as opposed to a message queue?
One has the word "command". The other has the word "message". The only other differences, therefore, are in whatever meanings you attach to those two words.
For example, some might argue that a "command" is a type of "message", but that the reverse is not true.
If i want to queue up intents basically commands so that the last intent/command in the queue runs only after the previous one before it finishes.
You do not provide any indication of what you are using these "intents basically commands" for. An Intent
in Android is used to start an activity, start or bind to a service, or send a broadcast. The characteristics of Intent
behavior will depend upon what you are using the Intents
for.
For example, sendBroadcast()
has no strict "queue" concept. However, an IntentService
does when used with startService()
-- it will buffer Intents
, waiting for onHandleIntent()
to complete processing the current Intent
before passing it the next one.
Android/Java offers this: http://developer.android.com/reference/java/util/Queue.html. But why wouldn't I use this: http://www.rabbitmq.com/java-client.html
RabbitMQ is for message queues between machines. You can tell this by reading the page you linked to ("The RabbitMQ Java client library allows Java code to interface to AMQP servers").
Queue
is a data structure used within a single app, as is everything in the java.util
package.
can't a command or an intent be a message too?
You are welcome to assign whatever meanings you wish to the terms "command" and "message".
But I want to allow users to execute "something" only after someone's "something" has executed.
There is no general-purpose inter-Intent
synchronization model in Android. Hence, without rewriting some of the operating system, you have no means of ensuring the coordination that you seek.