Skip to content

Commit

Permalink
Update SPEC to clarify streaming response body behavior
Browse files Browse the repository at this point in the history
Strings must be processed individually as they are yielded by `each`.
However, if the Body responds to `to_ary` it can be implicitly coerced to
an Array, which may then be processed all at once.
  • Loading branch information
wjordan committed Apr 26, 2021
1 parent 2c95c7d commit dd23436
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions SPEC.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ to that produced by calling +each+; this may be used by the
server as an alternative, possibly more efficient way to
transport the response.

Strings must be processed individually as they are yielded by +each+.
However, if the Body responds to +to_ary+ it can be implicitly coerced to
an Array, which may then be processed all at once.

The Body commonly is an Array of Strings, the application
instance itself, or a File-like object.
== Thanks
Expand Down

0 comments on commit dd23436

Please sign in to comment.