ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.32.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
<FromGitter> <636f7374> Asynchronous Logger (Log4j) uses LMAX Disruptor, which is considered the best performing?
<FromGitter> <636f7374> Disruptor is a library for the Java programming language that provides a concurrent ring buffer data structure of the same name, developed at LMAX Exchange. It is designed to provide a low-latency, high-throughput work queue in asynchronous event processing architectures. Wikipedia
<FromGitter> <636f7374> Seems difficult?
<FromGitter> <636f7374> Rust has something similar (multi-queue (https://docs.rs/multiqueue/0.3.2/multiqueue/)).
<FromGitter> <636f7374> MultiQueue functions similarly to the LMAX Disruptor from a high level view. There's an incoming FIFO data stream that is broadcast to a set of subscribers as if there were multiple streams being written to. There are two main differences: ⏎ ⏎ MultiQueue transparently supports switching between single and multiple producers. ⏎ ⏎ Each broadcast stream can be shared among multiple consumers.
ur5us has quit [Ping timeout: 245 seconds]
ur5us has joined #crystal-lang
return0e has joined #crystal-lang
return0e_ has quit [Ping timeout: 260 seconds]
<FromGitter> <oren> how to convert a file object into a string? File.open(some_file.txt)
renich has joined #crystal-lang
<FromGitter> <Blacksmoke16> File.read
<FromGitter> <oren> thank you
<FromGitter> <wsdjeg> hello, I am going to improve the crystal support in spacevim (https://spacevim.org), does crystal support windows os now?
<FromGitter> <tenebrousedge> windows support is still a work in progress
<FromGitter> <tenebrousedge> @wsdjeg thanks for your work on spacevim. Is there a way to force .svelte files to use html syntax highlighting?
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
<FromGitter> <wsdjeg> > Is there a way to force .svelte files to use html syntax highlighting? ⏎ ⏎ you can use autocmd ⏎ ⏎ `````` [https://gitter.im/crystal-lang/crystal?at=5e44c2ef63c15921f4768f96]
<FromGitter> <tenebrousedge> brilliant, thank you
juanfra_ has joined #crystal-lang
<FromGitter> <wsdjeg> no problem
juanfra_ has left #crystal-lang ["User left"]
<FromGitter> <wsdjeg> SpaceVim also has gitter channel , for general question, you can join it: https://gitter.im/SpaceVim/SpaceVim
juanfra_ has joined #crystal-lang
<FromGitter> <tenebrousedge> cool, thank you again
<FromGitter> <watzon> SpaceVim is nice
<FromGitter> <wsdjeg> @watzon Thank you
<FromGitter> <watzon> Oh you're actually the creator aren't you? I'm actually in the Telegram group for SpaceVim haha. I was really happy to see it has built in Crystal support when I first found it.
<FromGitter> <wsdjeg> yeah
<FromGitter> <watzon> Well keep up the good work 👍
<FromGitter> <wsdjeg> the telegram is bridged with gitter and irc channel
<FromGitter> <watzon> Yeah I'm in the gitter chat too
<FromGitter> <rurounijones_gitlab> Anyone know if it is possible to not use prepared statements in crystal-pg? I want to run many commands in one call to Postgres but getting`Unhandled exception in spawn: cannot insert multiple commands into a prepared statement (PQ::PQError)`. As far as I can tell it looks like prepared statements is the only option.
sagax has quit [Ping timeout: 272 seconds]
ur5us has quit [Ping timeout: 260 seconds]
sagax has joined #crystal-lang
postmodern has quit [Quit: Leaving]
_ht has joined #crystal-lang
_ht has quit [Quit: _ht]
ur5us has joined #crystal-lang
<FromGitter> <codenoid> how it's going
renich has quit [Quit: renich]
ur5us has quit [Ping timeout: 240 seconds]
<FromGitter> <yxhuvud> @rurounijones_gitlab I don't have an answer to you, but you should probably report that bug in the appropriate project.
<FromGitter> <rurounijones_gitlab> Don't think it is a bug, more a feature request
<FromGitter> <oren> How to get only folders and not filenames? I have the following: ⏎ ⏎ ```dir = Dir.open(folder) ⏎ dir.each_child { |x| ⏎ puts "Got #{x}" ⏎ }``` [https://gitter.im/crystal-lang/crystal?at=5e451b0645000661fcb9ca9c]
<FromGitter> <oren> why am I getting all false? `puts File.directory?(File.expand_path(x))`
<FromGitter> <oren> even though I have a few folders there
<FromGitter> <oren> for example: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e45205355b6b04bf6ac7a93]
<FromGitter> <oren> i think my issue is the expand_path. i
<FromGitter> <oren> expand_path doesn't give me the actual path of the file. instead i get the path of my executable
<FromGitter> <oren> so my question is how to get the absolute path of each childe
<FromGitter> <oren> i figured it out: .expand_path(x, "/tmp")
<FromGitter> <oren> i needed to pass a path as the second argument.
<sorcus> oren: :-)
<FromGitter> <oren> i am slowly getting a grip of the docs. or more literally a `grep` (:
<FromGitter> <oren> I build a tiny static site generator in a few hours. that's pretty cool
<FromGitter> <rurounijones_gitlab> What is the idiomatic way to stop a fiber that is processing an infinite loop?
<FromGitter> <yxhuvud> Perhaps you could have it check a channel regularly?
<FromGitter> <rurounijones_gitlab> No non-blocking `Channel#recieve` as far as I can tell.
<FromGitter> <rurounijones_gitlab> Only thing I could find is https://github.com/crystal-lang/crystal/issues/3561
<FromGitter> <rurounijones_gitlab> But that is from 2016 in a github ticket so not sure if it is still accurate and it uses `receive` which doesn't look right since it blocks processing
<FromGitter> <rurounijones_gitlab> Which is in itself apparently something not recommended by @straight-shoota in https://forum.crystal-lang.org/t/adding-size-to-channel/1695/3
<FromGitter> <rurounijones_gitlab> In my case I have multiple fibers. Some of them *do* use a channel as a job queue style setup so that could work however others don't so I cannot think of a way to shut them down.
Nicolab has joined #crystal-lang
<FromGitter> <636f7374> Oops! Heroku HTTP / 1.1 KeepAlive is not using the same socket !!!!
<FromGitter> <636f7374> Originally planned to use HTTP1.1 KeepAlive as a SOCKS5 wrapper, it seems that the plan is a mess (Heroku)
<FromGitter> <636f7374> It seems that in Heroku only WebSocket can be used to keep the same socket.
<FromGitter> <636f7374> Anyone with this intention please "detour".
<FromGitter> <straight-shoota> @rurounijones_gitlab You can check a simple flag on each iteration.
<FromGitter> <636f7374> <Client> <=Same socket=> <Heroku (Damn Cowboy)> <=Non-identical socket=> <Heroku Dyon>
<ancorgs> If anyone is interested, I posted a small summary of my experience trying Crystal as a Ruby "replacement"
<FromGitter> <kinxer> @ancorg Cool! I didn't realize YaST was in Ruby.
<FromGitter> <tenebrousedge> is there really only one shard for generating c++ bindings?
<FromGitter> <elorest> C++ bindings aren't very easy to do. You mean C bindings?
<FromGitter> <636f7374> I think it can be converted to WebSocket. Since SOCKS5 does not require Ping and Pong, this should be omitted.
<FromGitter> <636f7374> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e456fa319597421f3c8788f]
<FromGitter> <636f7374> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e456fccb612cc7bb1657e2c]
Vexatoast has quit [Quit: ZNC Quit]
Vexatos has joined #crystal-lang
Nicolab has quit [Quit: Leaving.]
Nicolab has joined #crystal-lang
_ht has joined #crystal-lang
<FromGitter> <plambert> If I have a class property `positive_number : Float64` what is the best way to enforce a constraint (i.e. "must be > 0.0") for the setter?
<FromGitter> <plambert> Just define the setter myself? `def positive_number=(value : Float64); raise "kaboom" unless value > 0.0; @positive_number=value; end`
<FromGitter> <tenebrousedge> that seems like a reasonable option
<FromGitter> <Blacksmoke16> there are also some shards to handle validation, depends on how you want to go about it
<FromGitter> <tenebrousedge> @Blacksmoke16 you have a shard for that, right?
<FromGitter> <Blacksmoke16> yea https://github.com/Blacksmoke16/assert
<FromGitter> <Blacksmoke16> implementation would be on the user tho, i.e. how they call `.validate`
<FromGitter> <Blacksmoke16> which depends on how the obj is getting instantiated
<FromGitter> <plambert> Cool, thanks.
<FromGitter> <Blacksmoke16> prob overkill if you just want to handle that one case
<FromGitter> <Blacksmoke16> but :shrug:
<FromGitter> <plambert> I've got a lot of assertions to make, so it looks like a great choice.
<FromGitter> <plambert> Thanks!
<FromGitter> <Blacksmoke16> 👍
<FromGitter> <Blacksmoke16> are you using like `.from_json`?
<FromGitter> <plambert> No.
<FromGitter> <Blacksmoke16> gotcha
<FromGitter> <plambert> I will probably add that eventually... but for now all `.new` calls are from code elsewhere...
<FromGitter> <Blacksmoke16> then yea could just add `validate!` within the initializer
<FromGitter> <Blacksmoke16> to raise an exception if its not alid
alexherbo2 has joined #crystal-lang
Nicolab has quit [Quit: Leaving.]
<FromGitter> <plambert> Cool, thanks!
<FromGitter> <plambert> Dumb question: are `case` statements exclusive?
<FromGitter> <plambert> In other words, do all matches execute, or only the first?
<FromGitter> <Blacksmoke16> prob just the first
<FromGitter> <plambert> Yes, just the first. Tested it. ;)
<FromGitter> <plambert> Danke schön!
<FromGitter> <Blacksmoke16> bitte
ur5us has joined #crystal-lang
alexherbo29 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 240 seconds]
alexherbo29 is now known as alexherbo2
_ht has quit [Remote host closed the connection]
sorcus has quit [Ping timeout: 256 seconds]
sorcus has joined #crystal-lang
ur5us has quit [Ping timeout: 245 seconds]