spinettaro / delphi-event-bus

Delphi Event Bus (for short DEB) is an Event Bus framework for Delphi
Apache License 2.0
466 stars 110 forks source link

[Question] "Active" property in TSubscription - how to use it? #67

Closed Voscha closed 3 years ago

Voscha commented 3 years ago

Hello, I want to know how I can use the "Active" property of TSubscription? I don't see any method to put them out of my program code. What is the correct way to disable the notification?

spinettaro commented 3 years ago

Hi @Voscha, if I understood well you want to stop receiving notification. That happens simply unregistering the Subscriber: GlobalEventBus.UnregisterForEvents(Subscriber);

Let me know if that is what you were looking for :)

Voscha commented 3 years ago

Hi Daniele, I would like to know what is the meaning of the active property of TSubscription and how can I use it? My idea was to use this property to temporarily turn off the reception of notifications. But you're right. I can also use 'register' and 'unregister' at any time. good luck with tonight's game! 🏆⚽

spinettaro commented 3 years ago

Hi @Voscha Active property of TSubscription is used for internal mechanisms of the framework, then the correct way is to use Register and Unregister :)