0

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. But I'm not lazy and am willing to read, study and learn.

What exactly is a command queue, as opposed to a message queue?

If i want to queue up intents, so that the last intent/command in the queue runs only after the previous one before it finishes, what data structure should I be aiming to learn/use?

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

The thing im stuck on is .... can't a command or an intent be a message too?

Intents are commands basically, I'm telling the system to execute something. But I want to allow users to execute "something" only after someone else's "something" has executed.

I have a way for many people to use one android, I just need some understanding on implementing the controls to the chaos.

sirvon
  • 2,547
  • 1
  • 31
  • 55
  • Why would you use a third party library if the functionality you're looking for is provided in the language? – Catherine Mar 06 '13 at 20:16
  • As CommonsWare has just informed me, "Queue is a data structure used within a single app" + "RabbitMQ is for message queues between machines". The app is remotely sending intents/commands to another app/android system to then process. So, the use of both libs come into play rabbitmq or such within the user app and the built-in lib within the host app/system. – sirvon Mar 06 '13 at 21:08
  • http://stackoverflow.com/questions/4962755/why-are-commands-and-events-separately-represented – sirvon Mar 28 '13 at 02:16

1 Answers1

1

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.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • thank you for your swift responses during my research, I have a clearer than before understanding on how to possibly use these options within my application. "RabbitMQ is for message queues between machines" + "Queue is a data structure used within a single app" ... that distiniction helped greatly. – sirvon Mar 06 '13 at 21:15