Skip to content

Commit f970665

Browse files
committed
README.md updated for v4.2.0
Added examples for Event Scheduling, and updated the future features accordingly.
1 parent 383dac0 commit f970665

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ let package = Package(
130130
dependencies: [
131131
.package(
132132
url: "https://github.com/Flowduino/EventDrivenSwift.git",
133-
.upToNextMajor(from: "4.0.0")
133+
.upToNextMajor(from: "4.2.0")
134134
),
135135
],
136136
//...
@@ -191,6 +191,19 @@ temperatureEvent.stack(priority: .highest)
191191
```
192192
Above would be with `.highest` *Priority*.
193193

194+
### Scheduled *Dispatching* of an *Event*
195+
Version 4.2.0 introduced *Scheduled Dispatch* into the library:
196+
```swift
197+
temperatureEvent.scheduleQueue(at: DispatchTime.now() + TimeInterval().advanced(by: 4), priority: .highest)
198+
```
199+
The above would *Dispatch* the `temperatureEvent` after 4 seconds, via the *Queue*, with the *highest Priority*
200+
```swift
201+
temperatureEvent.scheduleStack(at: DispatchTime.now() + TimeInterval().advanced(by: 4), priority: .highest)
202+
```
203+
The above would *Dispatch* the `temperatureEvent` after 4 seconds, via the *Stack*, with the *highest Priority*
204+
205+
*Scheduled Event Dispatch* is a massive advantage when your use-case requires a fixed or calculated time delay between the composition of an *Event*, and its *Dispatch* for processing.
206+
194207
### Defining an `EventThread`
195208
So, we have an *Event* type, and we are able to *Dispatch* it through a *Queue* or a *Stack*, with whatever *Priority* we desire. Now we need to define an `EventThread` to listen for and process our `TemperatureEvent`s.
196209

@@ -443,13 +456,10 @@ The above example would use the `EventPoolLowestLoadBalancer` implementation, wh
443456
## Features Coming Soon
444457
`EventDrivenSwift` is an evolving and ever-improving Library, so here are lists of the features you can expect in future releases.
445458

446-
Version 4.2.0 (or 5.0.0 if interface-breaking changes are required):
459+
Version 4.3.0 (or 5.0.0 if interface-breaking changes are required):
447460
- **Event Pool Scalers** - Dynamic Scaling for `EventPool` instances will be fully-implemented
448461
- **Latest-Only Events** - A Dispatch option to replace any unprocessed (older) *Events* with the newest *Event* of that specific *Eventable* type. This will be useful for things like sensor readings, where you only care about the most recent value possible (because older values are no longer relevant)
449462

450-
Version 5.1.0 (or 6.0.0 if interface-breaking changes are required):
451-
- **Event Scheduling** - A Dispatch Scheduler to ensure that *Events* aren't Dispatched until a specific time (or after a specific interval)
452-
453463
## License
454464

455465
`EventDrivenSwift` is available under the MIT license. See the [LICENSE file](./LICENSE) for more info.

0 commit comments

Comments
 (0)