brettwooldridge / NuProcess

Low-overhead, non-blocking I/O, external Process implementation for Java
Apache License 2.0
710 stars 84 forks source link

Support for configuring NuProcess buffer capacity via user property #152

Open avrecko opened 5 months ago

avrecko commented 5 months ago

Configurable via property com.zaxxer.nuprocess.bufferCapacity.

I've set the limits between 1 KiB and 1 MiB. They are arbitrary choices. Should handle use cases of 4, 8, 16, 32, 64 KB/KiB.

edit: could also set limit to something like 128 KiB? Thoughts?

bturner commented 5 months ago

Re: using 128K as the limit, I don't thing we need to super prescriptive here in the library. To some extent, I'm a bit inclined to just let the caller use whatever value they want, even if it's what I would consider excessively small or large, and not validate at all beyond ensuring it's a number (and defaulting the value if it isn't, rather than throwing).

If we're going to have a limit, I'd probably leave it as you have it.

avrecko commented 5 months ago

Re: using 128K as the limit, I don't thing we need to super prescriptive here in the library. To some extent, I'm a bit inclined to just let the caller use whatever value they want, even if it's what I would consider excessively small or large, and not validate at all beyond ensuring it's a number (and defaulting the value if it isn't, rather than throwing).

If we're going to have a limit, I'd probably leave it as you have it.

I think most if not all would want to use 4, 8, 16 or 32 as alternatives to 64. So I think a limit makes sense.