• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 239
  • Last Modified:

Giving a Queue a Unique Id and Name

I am looking to give my Queues a unique Name (a String) and unique ID (an int or other number).. Is this possible as I would really like to track/manage my queues.
0
directxBOB
Asked:
directxBOB
  • 2
  • 2
1 Solution
 
2266180Commented:
you have a variaty of possibilities. for example, just incrementing a number will give a unique number and the limit is pretty high (for an long it 2^64-1)
for a name, you can also use the ID and maybe something like "Queue" + ID;
or if you want something unique accross machines, you can use GUID's
0
 
directxBOBAuthor Commented:
ok but if I have

Queue myQueue = new Queue();

how do I give it a unique ID?

for example if I am passing in a string for a hashtable ID how do I tack that string on so it becomes the unique ID for the
0
 
directxBOBAuthor Commented:
Queue
0
 
2266180Commented:
you have at least 2 options, but none of it is ... perfect.
1) extend the Queue class and add the necessary fields.
2) use a hashtable or something like that in which you add either the ID or an object with the necessary fields

examples:
1)
class MyQueue : Queue{
  public int ID;
}
MyQueue q = new MyQueue();
q.ID = ID;
2) HashTable t;
t.Add(myQueue,ID);
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now