Personally I would pass a closure or null to the suspension to resume, e.g. static fn () => throw new ClosedException("The stream was closed by the peer");. It adds another function call to the stack trace, but the code seems less strange and Psalm should be more accepting of it.
Personally I would pass a closure or null to the suspension to resume, e.g.
static fn () => throw new ClosedException("The stream was closed by the peer");
. It adds another function call to the stack trace, but the code seems less strange and Psalm should be more accepting of it.