apple / apple/swift-configuration

Consider using inotify in Linux in addition to polling for file changes

Open
#40 4 comments 0 reactions 0 assignees View on GitHub
kind/enhancement status/needs-design
Dominant language
Swift
Stars
811
Forks
60
Avg merge
9h 38m
Merged PRs (30d)
6

Description

I only mention this because in reading the documentation, the default method of reloading the config files for JSON and YAML is by polling:

https://swiftpackageindex.com/apple/swift-configuration/0.1.1/documentation/configuration/using-reloading-providers

Might I suggest using inotify in Linux, and perhaps the equivalent file watching methods under Windows and macOS in future updates? We already use Inotify in a home-grown library we created that is similar to swift-configuration, so it's totally possible. Example:

https://github.com/orobio/swift-configuration-reader/blob/main/Sources/ConfigurationReader/ConfigurationFileWatching/watchFile.swift

Contributor guide

Open the contributing guide

Research direction

Start with the reloading-provider documentation linked in the issue and compare its polling behavior with the linked ConfigurationReader/watchFile.swift example. Determine the intended platform coverage and integration points; done should provide an agreed file-watching approach beyond polling, with corresponding tests or documented limitations.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.