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> 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> 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