Click here to Skip to main content
15,921,694 members
Home / Discussions / C#
   

C#

 
GeneralRe: How do you implement a message queuing system? Pin
Steve Messer25-Jun-06 3:47
Steve Messer25-Jun-06 3:47 
GeneralRe: How do you implement a message queuing system? Pin
Leslie Sanford25-Jun-06 5:35
Leslie Sanford25-Jun-06 5:35 
GeneralRe: How do you implement a message queuing system? Pin
Steve Messer25-Jun-06 5:54
Steve Messer25-Jun-06 5:54 
GeneralRe: How do you implement a message queuing system? Pin
Leslie Sanford25-Jun-06 6:27
Leslie Sanford25-Jun-06 6:27 
GeneralRe: How do you implement a message queuing system? Pin
Steve Messer25-Jun-06 7:46
Steve Messer25-Jun-06 7:46 
GeneralRe: How do you implement a message queuing system? Pin
Leslie Sanford25-Jun-06 8:24
Leslie Sanford25-Jun-06 8:24 
GeneralRe: How do you implement a message queuing system? Pin
Steve Messer25-Jun-06 8:56
Steve Messer25-Jun-06 8:56 
GeneralRe: How do you implement a message queuing system? Pin
Leslie Sanford25-Jun-06 9:16
Leslie Sanford25-Jun-06 9:16 
smesser wrote:
I like the idea of having an event id but I see a problem with it. As you mention you could request a list of all events available. Since the list would probably return human readable strings
it would make sense to have a plugin face that used strings to refer to them and an id for internal house keeping.


I agree. The reason I was using an integer event ID is that it makes it more efficient for the EventQueue than having to do a string look up. However, it would be easy to use strings instead and have the EventQueue use a hash table with the event names as keys.

smesser wrote:
If I requested a list of music events and the resulting list was 100, 123, 235 then you would have to maintain another list as to what they mean. And if the id aren't constant each time the app runs it could break the plugin. For example if id 5 means play. My code looks for a 5 the next time but now it's a 6. Just a thought.


Oh, this would be easy. You could retrieve the event ID for any event as long as you know the name. Something like this:

int eventID = eventQueue["EndOfSong"];


Then once you have this event ID, you can use it to send the EndOfSong event.

But you're right, using strings for event IDs would be simpler and more consistent, if less efficient for the EventQueue.

smesser wrote:
I think there is definitely room for two approaches here. The Callback delegate would be a good approach for most applications but for mine I think it would be better to let the System object have access to the eventqueue and the plugin manager and send out the messages via that path.


The system and well as plugin manager could have access to the EventQueue. They could create their own events that plugins could subscribe to. However, all of this may be overkill for what you want.

smesser wrote:
Each plugin has a function called bool OnMessage( ISystem SystemObject, IMessage Message);

It could return true/false if consumed or not and use the system object to create message to send the replies or responses.


That sounds good. I guess the question is how to route the messages to the specific plugins? What part of this approach are you fuzzy on as to how to implement it?
GeneralRe: How do you implement a message queuing system? Pin
Steve Messer25-Jun-06 12:35
Steve Messer25-Jun-06 12:35 
GeneralRe: How do you implement a message queuing system? Pin
Leslie Sanford25-Jun-06 13:20
Leslie Sanford25-Jun-06 13:20 
GeneralRe: How do you implement a message queuing system? Pin
Steve Messer25-Jun-06 13:37
Steve Messer25-Jun-06 13:37 
GeneralRe: How do you implement a message queuing system? Pin
Leslie Sanford25-Jun-06 13:48
Leslie Sanford25-Jun-06 13:48 
GeneralRe: How do you implement a message queuing system? Pin
Steve Messer25-Jun-06 14:20
Steve Messer25-Jun-06 14:20 
GeneralRe: How do you implement a message queuing system? Pin
Leslie Sanford25-Jun-06 15:17
Leslie Sanford25-Jun-06 15:17 
GeneralRe: How do you implement a message queuing system? Pin
Steve Messer25-Jun-06 18:08
Steve Messer25-Jun-06 18:08 
GeneralRe: How do you implement a message queuing system? [modified] Pin
Leslie Sanford26-Jun-06 5:18
Leslie Sanford26-Jun-06 5:18 
GeneralRe: How do you implement a message queuing system? Pin
Steve Messer26-Jun-06 7:22
Steve Messer26-Jun-06 7:22 
GeneralRe: How do you implement a message queuing system? [modified] Pin
Steve Messer4-Jul-06 8:44
Steve Messer4-Jul-06 8:44 
AnswerRe: How do you implement a message queuing system? Pin
Leslie Sanford27-Jun-06 6:08
Leslie Sanford27-Jun-06 6:08 
GeneralRe: How do you implement a message queuing system? Pin
Steve Messer27-Jun-06 6:31
Steve Messer27-Jun-06 6:31 
GeneralRe: How do you implement a message queuing system? Pin
Leslie Sanford4-Jul-06 8:56
Leslie Sanford4-Jul-06 8:56 
GeneralRe: How do you implement a message queuing system? Pin
Steve Messer4-Jul-06 9:53
Steve Messer4-Jul-06 9:53 
GeneralRe: How do you implement a message queuing system? Pin
Leslie Sanford4-Jul-06 10:15
Leslie Sanford4-Jul-06 10:15 
GeneralRe: How do you implement a message queuing system? [modified] Pin
Steve Messer4-Jul-06 11:07
Steve Messer4-Jul-06 11:07 
GeneralRe: How do you implement a message queuing system? Pin
Leslie Sanford4-Jul-06 11:09
Leslie Sanford4-Jul-06 11:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.