Skip to content

Repository files navigation

Knock-come

See the "knock-come" described at https://www.teigfam.net/oyvind/home/technology/009-the-knock-come-deadlock-free-pattern/

This is an implementation of the Knock-come pattern as described in the above note.

This is my first ever Rust project.

Also see https://github.com/Aclassifier/xc_test_knock_come

Automated build and packaging pipeline

The project includes a robust automation workflow through the build_app.sh script, which treats the Rust source code (rust_test_knock_come.rs) as the single source of truth.

How it works:

  • Dynamic extraction: The script parses the Rust file using grep and sed to automatically extract the active semantic mode, version number, and the exact app bundle name defined inside the CURRENT_APP_NAME match block
  • Safe configuration injecting: To package the application with context-specific metadata without altering project files permanently, the script creates a temporary backup (Cargo.toml.bak) and injects the extracted strings into placeholder slots in Cargo.toml
  • Zero-side-effect bundling: It triggers the compilation via cargo bundle --release. Immediately after compilation—regardless of success or failure—the modified configuration is discarded and the pristine, original Cargo.toml is fully restored from the backup, ensuring a clean and failure-proof build cycle
  • The newer cargo-packager should in the future perhaps be used instead of cargo-bundle

Acknowledgments

I have used Gemini (Google AI) as a great sparring partner during the development. It was like having an expert "friend" beside me. One to ask, trust and doubt - over and over. Good for a retired person sitting alone! Without it, this code wouldn't have existed!

Initially I also tested Claude (Anthropic), but hourly usage limits led me away from it.

About

The «knock-come» deadlock free pattern (in Rust)

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages