- I can start a thread, if I want shared memory parallelism
- I can start a process, if I want shared storage parallelism
- I cannot start a service, if I want shared network parallelism
What would it take to add a start API?
I could not agree more with my colleague and friend Travis Johnson's opinion that "[INTERCEPTORS ARE SO COOL][iasc]!" In that post, he succinctly describes the [Interceptor pattern][pattern] as used adroitly by [OkHttp][okhttp]. But, as is often the case, I believe a complicated object-oriented pattern obscures the simple functional gem within it.
I'll quote liberally from [OkHttp's documentation on the topic][okhttp-interceptor]:
Interceptors are a powerful mechanism that can monitor, rewrite, and retry calls. […] >
I've been writing Rust full-time with a small team for over a year now. Throughout, I've lamented the lack of clear best practices around defining error types. One day, I'd love to write up my journey and enumerate the various strategies I've both seen and tried. Today is not that day.
Today, I want to reply to a blog post that almost perfectly summarised my current practice.
Go read it; I'll wait!
| #!/bin/zsh | |
| set -euo pipefail | |
| SOURCE=${BASH_SOURCE:-$0} | |
| start_sudo_session() { | |
| sudo --validate | |
| while :; do |
| OPERATORS = "+-" | |
| def simplify_parens(expr): | |
| """ | |
| Remove all unnecessary parenthesis for a simple algebra-like string. It maintains the brackets, so any operator can be swapped for any other and the resulting expression will have the same results before and after parenthesis reduction. | |
| >>> simplify_parens('a') | |
| 'a' | |
| >>> simplify_parens('a + b') |
| tgray: tgray.c | |
| clang -g -std=c11 -Wall -framework ApplicationServices $^ -o $@ |
| CFLAGS=-Wall -Wextra -Werror -std=c99 -O | |
| all: cycle | |
| ./cycle | |
| cycle: cycle.c |
I hereby claim:
To claim this, I am signing this object:
| <html> | |
| <meta charset="utf-8" /> | |
| <style> | |
| body { background-color: white; margin: auto; text-align: center; } | |
| p { writing-mode: vertical-rl; } | |
| span { font-size: 3vh; } | |
| #off { color: white }; | |
| </style> |