<FromGitter>
<j8r> one can't pass `shuffle!(Random)` then
duane has quit [Read error: Connection reset by peer]
<oprypin>
yes, that is correct and expected
duane has joined #crystal-lang
<FromGitter>
<j8r> Just saying this is not very intuitive as an user
<FromGitter>
<j8r> `shuffle!(Random)` won't work but `shuffle!(Secure::Random)` will
<FromGitter>
<j8r> (if a type restriction is defined)
duane has quit [Ping timeout: 240 seconds]
duane has joined #crystal-lang
<FromGitter>
<mixflame> how do I tell `to_s` I want utf8?
<oprypin>
mixflame, you don't? to_s returns text, while utf8 is not text, it's a sequence of bytes
<FromGitter>
<mixflame> oh
andremedeiros has quit [Quit: ZNC 1.8.1 - https://znc.in]
andremedeiros has joined #crystal-lang
HumanG33k has quit [Ping timeout: 240 seconds]
<FromGitter>
<sirikon> Hi there 👋 , ⏎ ⏎ Is there any built-in mechanism in Crystal for a cancellable subscriber? ⏎ ⏎ I have a process running generating output, and also have a WebSockets connection. Want to send an stream of the process output thru the websockets connection, to the clients, but clients could disconnect, so the subscription should be cancellable. [https://gitter.im/
<FromGitter>
<sirikon> Could do it myself I guess, but if there's something already done in the stdlib, would prefer it :)
Munto has quit [Ping timeout: 246 seconds]
<FromGitter>
<j8r> If the client disconnect, then it would be an IO Error
<FromGitter>
<j8r> There is a `WebSocket::Handler#on_close` handler
<FromGitter>
<sirikon> Yea, I know that one, but if the mechanism is for example a block or a channel, I would then need to clean up after disconnection
<FromGitter>
<j8r> There is an infinite loop inside a fiber. When the connection is closed or any eror, `@on_close` is called, loop is broken and then fiber can finish
<FromGitter>
<mixflame> `sodium.cr` doesn't seem to work with `sodium-swift`