Home

Awesome

alt text

DEB an Event Bus framework for Delphi

Delphi Event Bus (for short DEB) is a publish/subscribe Event Bus framework for the Delphi platform.

DEB is designed to decouple different parts/layers of your application while still allowing them to communicate efficiently. It was inspired by EventBus framework for the Android platform.

alt text

Give it a star

Please "star" this project in GitHub! It costs nothing but helps to reference the code

alt text

Features

Show me the code

Events

1.Define events:

IEvent = interface(IInterface)
['{3522E1C5-547F-4AB6-A799-5B3D3574D2FA}']
// additional information here
end;

2.Prepare subscribers:

[Subscribe]
procedure OnEvent(AEvent: IAnyTypeOfEvent);
begin
  // manage the event 	
end;
GlobalEventBus.RegisterSubscriberForEvents(Self);

3.Post events:

GlobalEventBus.post(LEvent);

Channels

1.Define channel:

const MY_CHANNEL = 'MYCHANNEL'

2.Prepare subscribers:

[Channel(MY_CHANNEL)]
procedure OnMessage(AMsg: string);
begin
  // manage the message 	
end;
GlobalEventBus.RegisterSubscriberForChannels(Self);

3.Post event on channel:

GlobalEventBus.post(MY_CHANNEL, 'My Message');

Support

Release Notes

DEB 2.1

DEB 2.0

Breaking Changes

License

Copyright 2016-2022 Daniele Spinetti

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.