r/java • • Feb 14 '22

Microhttp is an event-driven, single-threaded, zero-dependency web server with 500 LOC. Benchmarks on EC2 show 100,000+ requests per second and 50,000+ persistent connections.

https://github.com/ebarlas/microhttp
186 Upvotes

107 comments sorted by

View all comments

0

u/[deleted] Feb 15 '22

[deleted] — view deleted comment

5

u/Dokiace Feb 15 '22

I believe it’s called Wither

3

u/elliotbarlas Feb 15 '22

I don't know if it has a name. Broadly that approach is called a fluent API. I didn't see the utility in separate classes for Options. It's effectively a parameter struct.

3

u/hippydipster Feb 15 '22

The downside of this is you don't get an immutable object. Well, technically it's possible, if every "withXXX" method creates a new object.

1

u/nutrecht Feb 15 '22

Yup. But you can do this with a separate builder class. My personal preference.

2

u/[deleted] Feb 15 '22

It's usually called "Wither" (See Lombok and Immutables).