<FromGitter>
<repromancer_gitlab> the compiler message it gives you isn't super clear if you don't already understand why it's being thrown, so I may not use the capability
<FromGitter>
<wwselleck> Array(Route) is an Array(Index). I'll be adding other Route classes later on, do I really have to declare `@routes` as `Array(Route)` in the mean time?
<FromGitter>
<Blacksmoke16> Would want to add ` of Route` yea
<FromGitter>
<Blacksmoke16> Like `[Indenx.new] of Route`
hypercore has quit [Ping timeout: 260 seconds]
<FromGitter>
<Blacksmoke16> Meh, typing on phone is hard
<FromGitter>
<Blacksmoke16> no i meant literally `[Index.new] of Route`
<FromGitter>
<wwselleck> OOOOOOO
<FromGitter>
<Blacksmoke16> your code is trying to say the type is `Array(Array(Route))`
<FromGitter>
<wwselleck> i missed that part
<FromGitter>
<wwselleck> ok thank you
<FromGitter>
<wwselleck> compiled! i am crystal master
<FromGitter>
<Blacksmoke16> \o/
<FromGitter>
<Blacksmoke16> are you making your own router?
<FromGitter>
<wwselleck> I'm just trying to write a personal website w/o 3rd party shards
<FromGitter>
<wwselleck> so yeah, writing some sort of router for it
<FromGitter>
<Blacksmoke16> fair enough
<FromGitter>
<Blacksmoke16> they have some lightweight router shards that would prob make that easier
<FromGitter>
<Blacksmoke16> but for your case it would prob be kinda easy, assuming you dont have to worry about route params and stuff?
<FromGitter>
<anamba> hmm. so i am mostly liking the MT except that every now and then i get "FATAL: tried to resume a dead fiber" + runaway CPU. I am trying to fix the root cause, but the associated runaway CPU is a little puzzling
<FromGitter>
<Blacksmoke16> is experimental for a reason :P
<FromGitter>
<Blacksmoke16> but yea, finding and making an issue with some reproducible code would be 💯
<FromGitter>
<wwselleck> welll I assumed I would need to implement routes like `/blog/:blogPostId`, but I may be able to simplify. I have "started programming post SPA frameworks" disease, so I tend to overcomplicate everything :P
<FromGitter>
<Blacksmoke16> oh so building a rest api?
<FromGitter>
<anamba> yeah i'm trying to see if i can distill this down into something simpler. but when i simplify, it works :)
<FromGitter>
<wwselleck> which I imagine involves creating a route like `/blog/:blogName`, and having to parse out that route and match it with a handler
<FromGitter>
<wwselleck> Which is ezpz with like kemal or whatever, but I'm using this project to start learning crystal
<FromGitter>
<wwselleck> woudl rather not reach for a shard
<FromGitter>
<Blacksmoke16> fair enough
<FromGitter>
<Blacksmoke16> if you're not going for pure speed woudl be pretty easy to just regex match the request path
<FromGitter>
<Blacksmoke16> and parse out the required elements then use a case or something
<FromGitter>
<wwselleck> I was just thinking that...I wish I was around pre-Angular so I was forced to write actual server websites instead of starting with SPA
<jhass>
discourse has an excellent email interface if you prefer that
duane has quit [Ping timeout: 246 seconds]
<mps>
ah, didn't know that it supports ML, will look at it
<jhass>
in your settings there's a "Mailling list mode"
<mps>
thanks
<FromGitter>
<skota> 1) @Blacksmoke16 sorry just saw your reply fro, yesterday. Yes please, if you can share an example on how to use sleep that would be great
<FromGitter>
<Blacksmoke16> might be easier with MT? as then a thread could be executing your timeout fibers while not blocking the main program
ht_ has joined #crystal-lang
<FromGitter>
<asterite> you need to do: `spawn do sleep 2; action; end`. That's the equivalent
DTZUZO has joined #crystal-lang
<FromGitter>
<skota> thanks @Blacksmoke16 your example worked , @vlazar - i meant setInterval not setTimeout, thanks for the link. @asterite - i will readup on concurrency and try again
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 268 seconds]
rohitpaulk has joined #crystal-lang
duane has quit [Ping timeout: 240 seconds]
rohitpaulk has quit [Ping timeout: 276 seconds]
<FromGitter>
<confact> I am thinking of doing some reload functionality to the crystal HTTP server which I have built a handler in to update db that is loaded on start. Could someone point me in the right direction for that or have some tip? Would be very appreciated.
<FromGitter>
<Blacksmoke16> reload functionality? like restart the server on change?
<FromGitter>
<confact> restart without closing down the socket/exit the program.
<FromGitter>
<j8r> that's the SIGHUP to catch
<FromGitter>
<j8r> it is a signal
<FromGitter>
<confact> the problem i solved a bit hacky now is to load the stuff from db in an array and then i send it all the way through handler as an argument. It is ugly. And i have to reset the http server somehow on the SIGHUP as you mention, don't know how.
<FromGitter>
<kinxer> Maybe `.new` should just be `protected` instead of `private`, but it seems like I should be able to use a private `.new` from within a class definition...
<FromGitter>
<Daniel-Worrall> @kinxer well std defines +'s with a T.new rather than calling an internal initialise so never runs into this kind of problem
<FromGitter>
<Daniel-Worrall> I believe it's functioning as expected
fyber has joined #crystal-lang
<FromGitter>
<kinxer> A'ight. Thank you.
<FromGitter>
<jwoertink> Anyone here using asdf know if there's a way to tell it to build with a specific llvm version?
<FromGitter>
<jwoertink> Or is there a way to tell crystal when building from source? I don't read Makefile very well, but I see `LLVM_CONFIG`
<FromGitter>
<jwoertink> maybe something like `LLVM_CONFIG=8 make clean crystal`?
<FromGitter>
<nsuchy> you can't compile amber anymore
<FromGitter>
<nsuchy> not even with the source from github and a supported crystal version
<FromGitter>
<nsuchy> Crystal really needs better version management for its package ecosystem
<FromGitter>
<bew> @kinxer not that in your examples, c is not a 3rd instance! Calling `initialize` does not create a new instance, it just initializes stuff.. If you want to create a new instance in your `+` method, call `new`
<FromGitter>
<bew> note*
<FromGitter>
<Daniel-Worrall> I use crenv
<FromGitter>
<Daniel-Worrall> Manages all my crystal versions
<FromGitter>
<kinxer> @bew Yeah, I've ended up using `protected`, but it seems weird that there's no way to do this without allowing access to the initializer from other classes in the module.
<FromGitter>
<kinxer> Is there just no way to access private class methods from instance methods?
<FromGitter>
<Daniel-Worrall> Yes, please update the shards file, nsuchy.
<FromGitter>
<bew> @kinxer i don't know, it's not intuitive to say the least
<FromGitter>
<nsuchy> I think Amber needs to update theirs
<FromGitter>
<nsuchy> ideally projects don't need to worry about their framework's dependencies
<FromGitter>
<nsuchy> the shard version says -> greater than or equal to X version
<FromGitter>
<nsuchy> so it'll pull whatever is newest as long as its greater than that version right?
<FromGitter>
<nsuchy> shouldn't there be a BUT less than part of shards.yml
<FromGitter>
<nsuchy> to avoid breaking changes every month until things get updated correctly?
<FromGitter>
<Daniel-Worrall> Do you understand what ~> means?
<FromGitter>
<nsuchy> not entirely
<FromGitter>
<nsuchy> that's why I asked
<FromGitter>
<Daniel-Worrall> `"equal to or greater than in the last digit"`
<FromGitter>
<Daniel-Worrall> so ~> 0.3.0 will update to 0.3.X but not to 0.4
<FromGitter>
<nsuchy> so those projects that pushed breaking changes, should of changed the number to let's say 0.4 rather than 0.3.x?
<FromGitter>
<Daniel-Worrall> Depends on their versioning semantics, but probably
mps has left #crystal-lang [#crystal-lang]
<FromGitter>
<nsuchy> so aside from forking amber, making a pr that'll probably rejected in favor of updates to the current one, or waiting until next week for someone else to fix it, is there anything I can do meanwhile?
<FromGitter>
<Daniel-Worrall> Don't make a pr
<FromGitter>
<Daniel-Worrall> Just point to a fork
<FromGitter>
<Blacksmoke16> also cant stress it enough you should be locking to specific versions in your actual app so this doesnt happen
<FromGitter>
<nsuchy> @Blacksmoke16 this is an issue
<FromGitter>
<nsuchy> compiling amber
<FromGitter>
<nsuchy> not my app
<FromGitter>
<nsuchy> I can't compile amber
<FromGitter>
<nsuchy> using the last release
<FromGitter>
<nsuchy> unless amber itself isn't locked to specific versions, this is an issue with amber itself not my app
<FromGitter>
<Daniel-Worrall> It's a problem with an old version of amber with an old version of crystal. If you want to make this work, fork and update to work
<FromGitter>
<Blacksmoke16> micrate the issue i think
<FromGitter>
<Blacksmoke16> it doesnt have a version lock on `crystal-db` so its using the latest release
<FromGitter>
<nsuchy> @Daniel-Worrall until recently when dependencies changed, this release of amber worked on 0.30.0-1
<FromGitter>
<nsuchy> @Blacksmoke16 if that's the case though amber needs to update micrate to add a lock