Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 6 of 6 total |
Anyone interested in a message queue? |
Mon, Dec 5 2022 5:43 PM | Permanent Link |
Ralf Mimoun | Hi,
I am probably not the only one who needs something like easy-to-use events or message queues. Example: You change data in one form, and other forms should reflect these changes by reloading the data. Another one: I use classes derived from TPersistent or TCollection/TCollectionItem to read config data (something for another day, you define "sub configs", put them together like Lego, and then you can read it from a URL). When everything is loaded, I need a message to resume with the app. So, I wrote a message queue. Object can subscribe to queues via name and unsubscribe (from one identified by name or from all queues). An object can push messages in the queue, and every subscriber will be notified. There is a global object called MessageQueues, which makes the handling very simple. To subscribe to a queue, you just write MessageQueues['MyQueue'].Subscribe(Self, ReceiveMethod); "ReceiveMethod" is the method that is called by the queue for each message in that queue. To send a message, you write MessageQueues['MyQueue'].PushNew(Self); You can use params, the definition is as follows: procedure TMessageQueueItem.PushNew(Sender: TObject; StrValue: string = ''; IntValue: integer = 0; BoolValue: boolean = False); Of course, there is more (like removing messages, check subscribers etc). It works like a charm and saves me tons of complicated code. I will need some hours to clean it up and add more remarks. Tell me if you are interested, and I'll upload it here. |
Tue, Dec 6 2022 4:42 PM | Permanent Link |
erickengelke | Ralf Mimoun wrote
: > I am probably not the only one who needs something like easy-to-use events or message queues. That's a brilliant idea. Otherwise there is a tangled list of upcalls to make to synchronize pages. Erick EWB Programming Books and Component Library http://www.erickengelke.com |
Tue, Dec 6 2022 10:00 PM | Permanent Link |
Steve Gill | Hi Ralf,
I'm very interested! = Steve |
Thu, Dec 8 2022 5:53 PM | Permanent Link |
Ralf Mimoun | Ok, here it is. Have fun
Attachments: MessageQueue.wbs |
Fri, Dec 9 2022 3:49 AM | Permanent Link |
Walter Matte Tactical Business Corporation | Thanks Ralf Mimoun!!!
|
Fri, Dec 9 2022 6:04 PM | Permanent Link |
Bill | Ralf, many thanks!
|
This web page was last updated on Thursday, May 23, 2024 at 07:54 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |