Ven has quit [Read error: Connection reset by peer]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 240 seconds]
pawnbox has quit [Remote host closed the connection]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 255 seconds]
Ven has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
Ven has joined #crystal-lang
soveran has joined #crystal-lang
greengriminal has quit [Quit: Leaving]
soveran has quit [Ping timeout: 245 seconds]
Ven has quit [Ping timeout: 256 seconds]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 245 seconds]
Ven has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
Kug3lis_off is now known as Kug3lis
Ven has joined #crystal-lang
Kug3lis is now known as Kug3lis_off
Ven has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
bjz has joined #crystal-lang
triangles has quit [Quit: Leaving]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Ven has quit [Ping timeout: 248 seconds]
Ven has joined #crystal-lang
bjz has joined #crystal-lang
Kug3lis has joined #crystal-lang
Kug3lis has quit [Client Quit]
Kug3lis has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 260 seconds]
Ven has quit [Ping timeout: 240 seconds]
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
Kug3lis has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 248 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 245 seconds]
akwiatkowski has joined #crystal-lang
mark_66 has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
Ven has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kug3lis has joined #crystal-lang
Ven has quit [Ping timeout: 258 seconds]
Ven has joined #crystal-lang
ome has quit [Quit: Connection closed for inactivity]
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has quit [Ping timeout: 240 seconds]
Kug3lis has joined #crystal-lang
Ven has joined #crystal-lang
gloscombe has joined #crystal-lang
Ven has quit [Ping timeout: 248 seconds]
Ven has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
bjz has quit [Ping timeout: 260 seconds]
bjz has joined #crystal-lang
Vallkury[m] has joined #crystal-lang
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rokf has joined #crystal-lang
Kug3lis has joined #crystal-lang
Kug3lis has quit [Client Quit]
Kug3lis has joined #crystal-lang
pawnbox has joined #crystal-lang
Ven has quit [Ping timeout: 240 seconds]
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
pawnbox has quit [Ping timeout: 255 seconds]
Kug3lis has joined #crystal-lang
Ven has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 245 seconds]
ome has joined #crystal-lang
gloscombe has quit [Ping timeout: 255 seconds]
gloscombe has joined #crystal-lang
Ven has joined #crystal-lang
soveran has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Ven has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Ven has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
akwiatkowski has quit [Ping timeout: 240 seconds]
matp_ has joined #crystal-lang
matp has quit [Ping timeout: 255 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<FromGitter>
<zatherz> is there a better way to check if a message has been sent in a channel than just having a buffered channel with capacity 2 and `!channel.empty?`?
<Yxhuvud>
What is the actual problem you are trying to solve? Please zoom out a little and perhaps we can give a more fitting solution.
<FromGitter>
<zatherz> I have a channel that I want to use to send "events" to a loop from another fiber
<FromGitter>
<zatherz> however, I don't want it to block until an event is sent every single time
Kug3lis has joined #crystal-lang
<RX14>
what?
<FromGitter>
<zatherz> I have a loop, and another loop running in a separate fiber
<FromGitter>
<zatherz> the other loop running in a separate fiber polls stuff and from time to time sends an Event object through a channel
<FromGitter>
<zatherz> the main loop is supposed to receive those events, but I don't want it to block on `channel.receive` until an Event object gets through
<FromGitter>
<zatherz> but I think I see how I can make it properly
<FromGitter>
<zatherz> just a separate dispatch fiber
<RX14>
no...
<RX14>
you need a nonblocking recieve
<RX14>
right?
<RX14>
so
<RX14>
literally recieve?
<RX14>
or wait does that block too
<RX14>
thats just confusing
<RX14>
you can use select regardless
Ven has quit [Ping timeout: 240 seconds]
<FromGitter>
<mjago> What can you do with an empty Slice (Slice(UInt8).empty) ?
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 252 seconds]
Ven has joined #crystal-lang
<FromGitter>
<zatherz> hmmm
<FromGitter>
<zatherz> I'm having difficulties printing to stdout from other fibers
<FromGitter>
<zatherz> it only prints if I also print from the "main" fiber (not in any `spawn` block)
<FromGitter>
<zatherz> and if I redirect it into a file it only prints what the main fiber printed
<FromGitter>
<zatherz> even if I do `STDOUT.flush` it's still the same
<FromGitter>
<mjago> Yes I see the use there. Thanks for the info
<FromGitter>
<mverzilli> you're welcome! usually when you want to know what's the use of something there's a good chance you'll find it out by searching for references in the stdlib or the compiler itself
<FromGitter>
<mverzilli> that's a cool benefit of working with a self-hosted language
<FromGitter>
<mverzilli> *sorry, should have said `Bytes` is an alias for `Slice(UInt8)`
<FromGitter>
<mjago> :+1: I knew what you meant! I’m not sure an empty Slice should blow up with hexdump though since it is a legitimate Slice. I submitted an issue for that.
<FromGitter>
<mjago> I love that Crystal is self-hosted :smile:
<FromGitter>
<bcardiff> @zatherz also check for `Fiber.yield`
<RX14>
@zatherz you have to either use IO or sleep to yield to the scheduler
<RX14>
except file IO doesn't count
pawnbox has quit [Remote host closed the connection]
<FromGitter>
<mverzilli> @mjago, yeah, it definitely shouldn't blow up. it's an unhandled case
<Kug3lis>
I am trying to dump crystal-db result set to json
<Kug3lis>
but I got stuck with Slice(UInt8) aka Bytes type...
<FromGitter>
<mverzilli> can you show how you're using it?
<FromGitter>
<bcardiff> @Kug3lis, to define a to_json you should define `def to_json(json : JSON::Builder)` which allow you to use the build for efficient json output. Note: the `: JSON::Builder` is mandatory here otherwise some overload will collide. Check https://gist.github.com/bcardiff/58d2c8cec73b0971b6eb990d6311485c
<crystal-gh>
[crystal] aurimasniekis opened pull request #3908: Added Int32 and Float32 to JSON::Type (master...feature/lower-size-types-for-json-type) https://git.io/vM6yf
pawnbox has quit [Remote host closed the connection]
unshadow has quit [Ping timeout: 240 seconds]
Ven has quit [Ping timeout: 240 seconds]
unshadow has joined #crystal-lang
Ven has joined #crystal-lang
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
unshadow has quit [Ping timeout: 240 seconds]
hako_ has quit [Ping timeout: 240 seconds]
unshadow has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
michael_campbell has joined #crystal-lang
Philpax has joined #crystal-lang
Philpax has quit [Ping timeout: 240 seconds]
Ven has quit [Ping timeout: 256 seconds]
Ven has joined #crystal-lang
bjz has joined #crystal-lang
bjz has quit [Ping timeout: 260 seconds]
Ven has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
DeBot has quit [Remote host closed the connection]
andrzejku has joined #crystal-lang
<andrzejku>
hey
DeBot has joined #crystal-lang
pawnbox has joined #crystal-lang
andrzejku has quit [Quit: Leaving]
<crystal-gh>
[crystal] Sija opened pull request #3914: Remove reduntant “?” from type definitions in bang accessors! (master...remove-question-marks-from-bang-accessors) https://git.io/vMPUT