TROEventReceiver
From RemObjects Software
This is a RemObjects SDK Architecture entry
Feel free to add your notes to this topic below.
Overview
The Event Receiver component is used on the client to enable receiving callback events from the server.
Depending on the channel type, this will be done by regularly polling the server for new events or, if the Channel supports active sending of events, by simply awaiting events to be sent from the server.
File
- uROEventRepository
Declaration
TROEventReceiver = class(TROChannelAwareComponent, IROObjectRetainer, IROEventReceiver, IROEventReceiverInvokers);
Hierarchy
- TROChannelAwareComponent
- TROEventReceiver
Properties
| | | |
|---|---|---|
| Active | Boolean | Active specifies whether the event receiver is currently processing events. |
| Channel | The channel to be used for receiving events. Unless the channel type is explicitly designed for consecutive requests (such as the Super TCP Channel), it is recommended that you use a different channel instance from the one used for your regular communication. | |
| Interval | Integer | The interval, in milliseconds, at which the receiver will poll for new events. Default is 30,000 (30 seconds). |
| Message | The message format used to decode the events received. Because events are handled based on the ClientID stored in the message, it is recommended to assign the same message that you are also using for your regular communication or to manually sync the ClientID between the two messages. | |
| OnActivate | TNotifyEvent | Fired when the event receiver has been activated and will start receiving events. |
| OnDeactivate | TNotifyEvent | Fired when the event receiver has been deactivated and will stop receiving events. |
| ServiceName | String | The name of the Service from where events are to be received. |
| SynchronizeInvoke | Boolean | Whether events will be fired in the context of the main VCL thread (true, default) or not (false). By default, the Event Receiver will synchronize all events back to the main VCL thread, which makes it safe to access the user interface from your event handler code.
If UI access is not needed, and your event handlers are implemented in a thread-safe fashion, you can disable this property to gain performance by having events fire in the thread where they were received. Also, if you are performing lengthy operations in your event handlers, your UI might freeze while event handlers execute and block the main VCL thread (which is responsible for user interaction); disable this property to avoid that. |
Methods
| | |
|---|---|
| Activate | |
| AreEventHandlersRegistered | Checks whether the passed event handlers are currently registered. |
| Deactivate | |
| IsEventHandlerRegistered | Checks whether the passed event handler is currently registered. |
| RegisterEventHandlers | Used to register one or more classes to receive events. |
| ReleaseObject | |
| RetainObject | |
| UnregisterEventHandlers | Used to unregister one or more event handlers previously registered via RegisterEventHandlers. |
Events
| | |
|---|---|
| OnPollException |
Fired when the event receiver has encountered an error while polling for events. |
See Also
Product: RemObjects SDK
Current version: RemObjects SDK 'Vinci' (5.0)
Lists — Glossary — Features — How To — Components — Tools — Samples — Articles — Architecture — Issues
Categories: Text | RemObjects SDK | Architecture | Class | Component | Delphi
