stream interface + satisfy consumer interface #18
Conversation
Good question. On one hand, it seems useful to be able to close the stream with the interface handle, on the other it's a little weird what return type to choose for missed info We could use Yet, if we don't include the A third option is having another function like
But still is weird 😢 Wdyt about this last option? |
hey sorry, have been busy. i think there is some merit in making a function and add say a it's a breaking change, but it's easy to fix and I think most users won't be affected. users upgrading will already have to decide if they wish to upgrade to the interface, and they will have to change the type if they wish to access the special close method anyways, so i think it's good to use this as an opportunity to be more standard with io.Closer the final secret wildcard option is to add a second generic type parameter that dictates the response type of close :) what do you think? |
a few breaking changes here....
*Stream[T]before should change to eitherStream[T]or*RedisStream[T]@dranikpg did you know that neither consumer matched the consumer interface? i noticed when i added the interface check. im not sure if my any solution here is good, it was just easy.
perhaps its better to unite these two return types into a single return type that can be shared by the close method? not sure. any thoughts?