jhass changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Crystal 0.35.1 | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
<oprypin> yea easy enough https://carc.in/#/r/9p88
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #crystal-lang
alexherbo24 has joined #crystal-lang
alexherbo2 has quit [Read error: Connection reset by peer]
alexherbo24 is now known as alexherbo2
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #crystal-lang
alexherbo24 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 244 seconds]
alexherbo24 is now known as alexherbo2
alexherbo2 has quit [Ping timeout: 244 seconds]
<FromGitter> <mwlang> got a weird one, so taking a shot in the dark before trying to build out a minimal reproduction. Exactly 563 HTTP GET calls, I get this socket error every time: `#<Socket::Addrinfo::Error:Hostname lookup for api.binance.com failed: No address found>` Retrying the GET just continues to not resolve the address. Does this ring a bell with anyone? FWIW, I am using the Cosack gem and not the HTTP stdlib
<FromGitter> ... directly, so my first thought is to try to reproduce without Cosack, but really, the error makes no sense whatsoever.
<FromGitter> <mwlang> same code in Ruby to the same server and endpoint works w/o issue.
<FromGitter> <Blacksmoke16> would be worth reproducing w/o that extra shard
<FromGitter> <mwlang> one thing I am noticing is that 253 ports are opened and it maxes out there even though the loop goes on to 563 calls.
<FromGitter> <mwlang> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5f5ec769c1d1a537059e97a5]
<FromGitter> <mwlang> ok, I'll put some effort into reproducing without the extra shard in the mix
zorp has quit [Ping timeout: 260 seconds]
<FromGitter> <christopherzimmerman> Has anyone seen anyone working on / worked on OpenMP and Crystal?
<FromGitter> <mwlang> I know cloudfront is in front of the API endpoints, but I don't think that's specifically the issue here. Feels more like local resources are exhausted and then the system isn't able to do any more name resolutions
_whitelogger has joined #crystal-lang
lunarkitty7 has quit [Quit: Konversation terminated!]
deavmi has quit [Read error: Connection reset by peer]
deavmi has joined #crystal-lang
<FromGitter> <mwlang> wow. I didn't expect it to make a difference, but using HTTP::Client directly solves the issue. I can see the nested use of resources in the thread sampling is vastly reduced
<FromGitter> <Blacksmoke16> 👍 nice
<FromGitter> <Blacksmoke16> sounds like something to report within that shard then
<FromGitter> <mwlang> looks like I need to do some major refactoring on the binance project.
<FromGitter> <mwlang> yeah, but I have no idea still what it might be. :-/
<FromGitter> <Blacksmoke16> be aware `HTTP::Client` isnt fiber safe. might run into some issues if you try to use the same client in multiple fibers
<FromGitter> <mwlang> not doing anything fiber related
<FromGitter> <mwlang> but the shard might be
<FromGitter> <Blacksmoke16> 👍
<FromGitter> <mwlang> The shard seems to be abandoned. It's been 3 years since it was last touched and I had to fork it to upgrade crystal version and fix some things along the way.
<FromGitter> <Blacksmoke16> rip
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 240 seconds]
<FromGitter> <mwlang> wow, I didn't expect to get done with ripping out Cossack as a dependency in one night's sitting, but Crystal's HTTP::Client and HTTP::Client::Response classes make a lot more sense this time around than first time around when I was first starting with Crystal
<FromGitter> <Blacksmoke16> :p good to hear
<FromGitter> <mwlang> without cossack, downloaded 1,596,000 candles for BNBBTC...sadly, its taking forever and a day to write the resulting JSON data to file. :-p
<FromGitter> <Blacksmoke16> how are you doing it? I hope via IOs?
<FromGitter> <mwlang> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5f5eebabce5bbc7ffdc31bf8]
<FromGitter> <Blacksmoke16> oof
<FromGitter> <Blacksmoke16> `series.to_json f`
<FromGitter> <Blacksmoke16> should be better
<FromGitter> <mwlang> Ah! TIL
<FromGitter> <Blacksmoke16> prevents needing to load the JSON string into memory just to write it to the file
<FromGitter> <mwlang> so a streamed build and write?
<FromGitter> <Blacksmoke16> yea writes the data as it reads
<FromGitter> <mwlang> my version builds the whole JSON in memory before writing, doesn't it?
<FromGitter> <Blacksmoke16> yes
<FromGitter> <mwlang> What's the optimized way to read the json from file?
<FromGitter> <Blacksmoke16> `MyClass.from_json io`
<FromGitter> <mwlang> ok, cool. Time to learn a little bit more about IO in Crystal
<FromGitter> <Blacksmoke16> 👍
<FromGitter> <mwlang> yeah, I can see the memory consumption with what I was doing...5.45GB of Virtual RAM (it's still building the JSON to write it)
_whitelogger has joined #crystal-lang
repo has quit [Quit: WeeChat 2.9]
repo has joined #crystal-lang
hightower3 has quit [Ping timeout: 260 seconds]
alexherbo2 has joined #crystal-lang
alexherbo23 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 240 seconds]
alexherbo23 is now known as alexherbo2
zorp has joined #crystal-lang
<repo> hey Blacksmoke16!
<repo> i have a service that holds the connection to an mqtt broker and i'd like to share that with all threads
<repo> is that somehow possible?
<repo> i'll try using a class var
alexherbo2 has quit [Ping timeout: 256 seconds]
alexherbo2 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 244 seconds]
<FromGitter> <Blacksmoke16> That would probably be the easiest solution. I assume there isn't any con in having it be used in multiple requests?
alexherbo2 has joined #crystal-lang
z64 has joined #crystal-lang
<FromGitter> <grkek> Big piss off was received a couple of hours ago
<FromGitter> <grkek> I think the Lib UI is dying and I am moving the lib towards Gtk
<FromGitter> <grkek> already ported 4 components + you gain a lot more flexibility using the Gtk module
alexherbo2 has quit [Ping timeout: 244 seconds]
<FromGitter> <phykos> hello there
<FromGitter> <Blacksmoke16> hi
<FromGitter> <phykos> `$1` in Ruby is a global variable and indicates "Contains the subpattern from the corresponding set of parentheses in the last successful pattern matched", is there such functionality/variable in Crystal?
<FromGitter> <Blacksmoke16> yes, its the same
<FromGitter> <phykos> ignore that "indicates"...
<FromGitter> <phykos> oh but aren't global variables not implemented in Crystal yet?
<FromGitter> <phykos> well it it works then let's go
<FromGitter> <Blacksmoke16> `$N` and `$~` are the only ones afaik
<FromGitter> <Blacksmoke16> and they're built in, cant define your own
<oprypin> @phykos: global variables were removed
<oprypin> @Blacksmoke16: those are not global variables
<FromGitter> <Blacksmoke16> pretty sure they are
<oprypin> @Blacksmoke16: see explanation https://github.com/crystal-lang/crystal/issues/4715
<oprypin> "leaks by one scope level" https://carc.in/#/r/2d82
<FromGitter> <Blacksmoke16> huh fair enough
alexherbo2 has joined #crystal-lang
_whitelogger has joined #crystal-lang
f1reflyylmao has quit [Quit: bye fags]
f1refly has joined #crystal-lang
<FromGitter> <wontruefree> Chicago Crystal just released a new episode http://podcast.chicagocrystal.org/1030945/5438719
<FromGitter> <Blacksmoke16> `Kingsley Hendrickse Github` I think that name is wrong
<FromGitter> <Blacksmoke16> @wontruefree
<FromGitter> <wontruefree> thanks !!!
<FromGitter> <wontruefree> ops
<FromGitter> <wontruefree> I need a better template for this
<FromGitter> <Blacksmoke16> 👍
<FromGitter> <grkek> So is GTK a viable way to go for UI ?
<FromGitter> <j8r> Depends on what you mean by viable...
<FromGitter> <j8r> GTK2 to GTK3 was a lot of work, GTK4 will be less
<FromGitter> <j8r> The only viable interface is CLI, and warning: HTML :P
<FromGitter> <j8r> (You didn't say sane, just viable)
<FromGitter> <Blacksmoke16> https://userinyerface.com/
alexherbo2 has quit [Remote host closed the connection]
teardown has joined #crystal-lang
teardown has quit [Read error: Connection reset by peer]
teardown has joined #crystal-lang
teardown has quit [Read error: Connection reset by peer]
teardown has joined #crystal-lang
teardown has quit [Read error: Connection reset by peer]
teardown has joined #crystal-lang
teardown has quit [Read error: Connection reset by peer]
teardown has joined #crystal-lang
teardown has quit [Read error: Connection reset by peer]
alexherbo2 has joined #crystal-lang
teardown has joined #crystal-lang
teardown has quit [Read error: Connection reset by peer]
teardown has joined #crystal-lang
teardown has quit [Read error: Connection reset by peer]