Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.10.0] - 2026-01-10

### Changed (BREAKING)

- `CommandHandler::on_startup()` now receives `pid: u32` as second parameter

## [0.9.0] - 2025-12-29

### Changed (BREAKING)
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "daemon-cli"
version = "0.9.0"
version = "0.10.0"
edition = "2024"

[dependencies]
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,10 @@ where

/// Called once when the daemon starts, before accepting connections.
///
/// Override this method to log the startup reason or perform
/// Override this method to log the startup reason and PID, or perform
/// initialization that depends on whether this is a fresh start
/// or a restart.
///
/// The default implementation does nothing.
fn on_startup(&self, _reason: StartupReason) {}
fn on_startup(&self, _reason: StartupReason, _pid: u32) {}
}
4 changes: 2 additions & 2 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ where
"Daemon started and listening"
);

// Notify handler of startup reason
self.handler.on_startup(self.startup_reason);
// Notify handler of startup reason and PID
self.handler.on_startup(self.startup_reason, pid);

loop {
// Select between accepting connection and shutdown signal
Expand Down