Epic is a simple operations manager written in Swift.
The Throttle regulates how many executions can get through the same bottleneck within a given amount of time.
let throttler = Throttle(interval: 0.2)
...
/// 5 calls to the throttle block
throttler.throttle {
API.shared.makeRequest(...) // Just 2 came through
}
It prevents overloads on potentially repetitive and intensive calls to a limited resource, and thus these calls will not degrade the performance of the whole system.
For further documentation, check the docs.
The Generator supplies block operations of a sequence one at a time.
It complies to Swift's IteratorProtocol.
let generator = Generator(operations: [
Operation("app.open.home_screen", block: { ... }),
Operation("app.fetch.user_data", block: { ... }),
Operation("app.populate.home_screen", block: { ... }),
])
var iterator = generator.iterator()
iterator.next(executingBlock: true)
For further documentation, check the docs.
The MessageBus is a single entry for all your broadcast messages within your application.
It provides support for brokers and topics through protocols, so you can also inter-operate with your own.
By using a MessageBus all of your messages have the same structure (type and payload). Only the subscribed recipients are able to retrieve the right information for their purposes.
static let messageBus = MessageBus()
messageBus.send(messages: [
Message(types: ["analytics"], payload: [:...]})
Message(types: ["user_event", "debug"], payload: [:...])
])
For further documentation, check the docs (Documentation in Progress).
Currently, only one extension over Sequence is included in Epic.
For further documentation, check the docs.
The Swift Package Manager is Apple's official tool for automating the distribution of Swift code.
Add Epic
to your Project’s ‘Swift Packages’ section or add Epic as a dependency to the dependencies value of your Package.swift
.
dependencies: [
.package(url: "https://github.com/Maquert/Epic.git", .upToNextMajor(from: "0.2.2"))
]
import Epic
Epic is maintained by Miguel Hernández Jaso.
Header backdrop photo is a creation by Daniela Rogoza.
link |
Stars: 3 |
Last commit: 2 years ago |
Since 0.3, the Throttle won't deal with nil operations when calling to the throttle
method.
This might break some calls to the throttle function, but those are minor changes clients probably were not dealing with anyway.
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics