project jw
content
motivation
- scratch your own itch
system design
- first time thinking about system design
- how to structure a CLI tool
- how to think about abstraction and structure different layers
- CLI layer → daemon layer → config layer
- but sometimes CLI layer talks to config layer directly
- authentication, jenkins crumb, persist token
implementation
- actually using signal to communicate between processes:
- when
jw addis run, it sendsSIGHUGto daemon, in order to signal daemon to reload config file - consider between unix socket and current decision
- when
- how to deal with race condition, indirect communication:
- right now: cli sends
others
- my own tool, my own decision
- make decisions and perform refactoring
- the project is for learning purpose
- getting hands-on experience to understand system design concepts like singleton pattern
-
A Singleton pattern is a software design pattern that makes sure a class has exactly one instance and provides a global way to access it.
-
- getting hands-on experience to understand system design concepts like singleton pattern