You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any official consensus and/or documentation on the implementation and use of abstract/OO types for streams in Janet?
What methods is a stream required to implement to be considered a "stream"? For example, ev/ streams seem to offer the :close, :read, :chunk and :write methods, but net/ has a bunch more (:flush, :accept, etc)
Is networking (library) code that builds on streams encouraged to use abstract method calls instead of calling net/... or ev/... functions directly? For example, Spork's HTTP code at this time depends directly on ev/... functions, which makes it hard (impossible) to re-use this code when running on my own stream types.
The text was updated successfully, but these errors were encountered:
:close, :read;, :chunk, and :write are certainly what I would want to implement. If you use these methods, really are just using duck-typing for the streams, which is fine but you may want more. For example, :flush might make sense here but :accept probably does not.
I think it would be helpful to define and document the mandatory set required to implement a stream so producers know what to offer, and consumers know what is safe to call without run time errors.
Is there any official consensus and/or documentation on the implementation and use of abstract/OO types for streams in Janet?
ev
/ streams seem to offer the:close
,:read
,:chunk
and:write
methods, butnet/
has a bunch more (:flush
,:accept
, etc)net/...
orev/...
functions directly? For example, Spork's HTTP code at this time depends directly onev/...
functions, which makes it hard (impossible) to re-use this code when running on my own stream types.The text was updated successfully, but these errors were encountered: