Swiftpack.co - kennethlaskoski/FileSystemEventPublisher as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by kennethlaskoski.
kennethlaskoski/FileSystemEventPublisher 3.0.0
A publisher that emits events in the file system.
⭐️ 6
🕓 5 weeks ago
iOS macOS
.package(url: "https://github.com/kennethlaskoski/FileSystemEventPublisher.git", from: "3.0.0")

FileSystemEventPublisher

A publisher that emits events in the file system.

Overview

The FileSystemEventPublisher framework wraps a Combine Publisher around a DispatchSourceFileSystemObject, providing a modern high-level interface to an efficient way of monitoring filesystem events.

Usage

A typealias and a function are all the exposed interface, the Combine framework provides all remaining functionality.

The publisher is created by a function with two parameters: a file and a set of events; this signature reflects the underlying DispatchSource interface and was adopted for it's simplicity and performance.

The first parameter is a mask containing events of interest. The set of events are defined by a typealias to DispatchSoutce.FileSystemEvent. This type is also the Output of the created publisher, i.e., the type of values to be delivered to subscribers.

The second parameter is a FileDescriptor pointing to an open file, folder or socket.

The package includes a playground with a short example code.

GitHub

link
Stars: 6
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

Version 3
5 weeks ago

Added DocC documentation.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics