jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.11.1 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/manastech/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
shama has quit [Quit: (╯°□°)╯︵ɐɯɐɥs]
<jeromegn> Definitely worth checking into it then :)
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 256 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 264 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 250 seconds]
tomchapin has joined #crystal-lang
pawnbox has joined #crystal-lang
<crystal-gh> [crystal] MakeNowJust opened pull request #2163: Implement proc.(:call) syntax (master...feature/proc-call-syntax) https://git.io/vg7JM
Philpax has quit [Ping timeout: 276 seconds]
srenatus has joined #crystal-lang
Davy_CC has quit [Ping timeout: 240 seconds]
Davy_CC has joined #crystal-lang
grindhold has quit [Ping timeout: 256 seconds]
grindhold has joined #crystal-lang
Philpax has joined #crystal-lang
<crystal-gh> [crystal] MakeNowJust opened pull request #2164: Check AtomicWithMethodCheck in parse_call_block_arg (master...fix/check-atomic-in-block) https://git.io/vg7CL
tomchapin has quit [Read error: Connection reset by peer]
zodiak_ has joined #crystal-lang
zodiak has quit [Ping timeout: 240 seconds]
renews has joined #crystal-lang
rvchangue has quit [Ping timeout: 276 seconds]
rvchangue has joined #crystal-lang
renews has quit []
tomchapin has joined #crystal-lang
tomchapin has quit [Read error: Connection reset by peer]
tomchapin has joined #crystal-lang
trapped has joined #crystal-lang
Cidan has quit [Ping timeout: 240 seconds]
Cidan has joined #crystal-lang
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
trapped has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vg7x1
<crystal-gh> crystal/master 90eaec1 Ary Borenszweig: URI.escape: iterate bytes, not chars. Fixes #2161
<travis-ci> manastech/crystal#90eaec1 (master - URI.escape: iterate bytes, not chars. Fixes #2161): The build passed. https://travis-ci.org/manastech/crystal/builds/109594516
<DeBot> https://github.com/manastech/crystal/issues/2161 (HTTP::Params with binary data bug)
<jokke> hey
<jokke> anyone here familiar with kemal?
<jokke> is there something similare like sinatras mounts for kemal?
<jokke> so that i could subclass something like Sinatra::Base and mount it at some route?
<jokke> also, are kemal requests multithreaded? (i know, there's no _real_ multithreading yet), but i'm asking if one long request is blocking subsequent requests.
<BlaXpirit> ^try and see
<jokke> :)
<jokke> BlaXpirit: what about the other points?
<BlaXpirit> no idea. i'm not interested in crystal for web at all
<jokke> ok
<BlaXpirit> sure is quiet here, almost all the nicks i've never seen speak
pawnbox has quit [Ping timeout: 256 seconds]
Bofu2U has left #crystal-lang ["Textual IRC Client: www.textualapp.com"]
Philpax has quit [Ping timeout: 248 seconds]
<jeromegn> jokke according to https://github.com/sdogruyol/kemal/blob/master/src/kemal.cr Kemal only runs one thread.
pawnbox has joined #crystal-lang
tomchapin has quit [Read error: Connection reset by peer]
<asterite> jokke: if one request is doing CPU-only stuff, no IO, then it will block other requests
trapped has quit [Quit: Textual IRC Client: www.textualapp.com]
<jokke> alright
<jokke> are there any plans on making JSON.mapping extendable by subclasses?
<jokke> or is it maybe already possible, and i just don't know about it
trapped has joined #crystal-lang
<jhass> what do you mean by extendable?
<jokke> jhass: let's say i have an abstract class A that defines some json mapping. then i have classes B, C and D extending A and defining additional mappings to the ones A defined
<jhass> ah no, I don't think you can do inheritance yet
<jhass> only composition
<jokke> jhass: how?
<jhass> simply by using an existing mapping as type
<jokke> yeah ok
<jokke> sure
<jokke> is the type automatically used as converter then?
<jokke> meaning if type == converter, i only have to define type?
tomchapin has joined #crystal-lang
<jokke> also what about type: Array(SomeMapping)? does that kind of thing work ootb?
<jokke> or do i have to provide a converter which parses the json array?
<jhass> there's simply no need to specify it as a converter
<jhass> a json mapping can receive a pull parser
<jhass> and that's how it works internally
<jhass> yes
<jhass> no need for a converter
<jokke> yeah ok. so it just calls Type.new(pull)
<jokke> ok that's convenient
<jokke> i really like the mappings
<jokke> (yaml and json)
<jokke> the only problem is when you got types that are only apparent after the json has been parsed
<jokke> like when there's some "type" value in the json
<jhass> yeah, I'd still double parse in that case
<jokke> in that case it'd be great if there would be some kind of "pass-through" mode for the pull parser to get the json string
<jokke> you know what i mean?
<jhass> I can't imagine anything making much sense I'm afraid
<jokke> so if i have some SometimesThisSometimesThatMapping it could parse the json and simultaniously write it back into a string which it would then pass to either ThisMapping.new or ThatMapping.new, depending on some "type" value
<jokke> not the string, but a pull parser for that string of course
<jokke> as far as i know, now the only way to do it is by parsing the stuff, then decide the type, then pass that stuff .to_json to the actual type, right?
<jhass> I'd do case TypeMapping.from_json(json_string).type; when "foo"; FooMapping.from_json(json_string); when "bar"; BarMapping.from_json(json_string); end
<jhass> depending on context with some macro sugar
<jokke> jhass: but in a JSON.mapping i don't have access to the json string
<jhass> I don't see how that's relevant to my suggestion
<jokke> well if you assume your polymorphic json mapping type is somewhere at a deep level of a larger json mapping
<jokke> then you have a problem
<jhass> well I didn't
<jokke> :)
<jhass> of course my suggestions only apply to the requirements stated
<jokke> yeah, i wasn't clear on that
<jokke> so for those cases it'd be great if JSON::PullParser would have some kind of read_*_as_string method
<jokke> but maybe i'm just overcomplicating things.
<jokke> it won't kill me to read a hash of String => JSON::Type and then to_json it again
<jokke> oh i just realized, that i can't do that either...
<jokke> JSON::Parser doesn't use a pull parser
<jhass> yeah, a pull parser interface over JSON::Any is still something that would be interesting
<jhass> maybe mapping everything to iterators and building a stack of those, mmh
ponga has joined #crystal-lang
<jokke> yeah
tomchapin has quit [Read error: Connection reset by peer]
pawnbox has quit [Ping timeout: 252 seconds]
tomchapin has joined #crystal-lang
Sadin has joined #crystal-lang
shama has joined #crystal-lang
<asterite> Parsing polymorphic JSONs would be really nice. I guess there's no other way to do it other than parsing it twice, so that would be fine by me. Maybe what you did in the past (jhass), parsing from a json/any into an object could work
tomchapin has quit [Read error: Connection reset by peer]
jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.12.0 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/manastech/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
pawnbox has joined #crystal-lang
tomchapin has joined #crystal-lang
tomchapi_ has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Sadin has quit [Ping timeout: 250 seconds]
tomchapi_ has quit [Ping timeout: 265 seconds]
shadeslayer has quit [Ping timeout: 276 seconds]
shadeslayer has joined #crystal-lang
tomchapi_ has joined #crystal-lang
tomchapin has quit [Quit: Textual IRC Client: www.textualapp.com]
sdogruyol has joined #crystal-lang
fka has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
ponga has quit [Quit: Connection closed for inactivity]
fka has quit [Remote host closed the connection]
greengriminal has joined #crystal-lang
Excureo has quit [Remote host closed the connection]
tomchapi_ has quit [Read error: Connection reset by peer]
tomchapin has joined #crystal-lang
Sadin has joined #crystal-lang
<jokke> hey
<jokke> i have another question about kemal
<jokke> i'm writing a json api and it feels repetetive to always have to set content type to application/json
Philpax has joined #crystal-lang
<jokke> so would this call for a handler? which set's the content type and calls next?
<jokke> and i have another problem with kemal: i want to use my own error handler
<jokke> so that i can raise a custom error class (or subclasses of it)
<jokke> i tried wrapping call_next with begin ... rescue e : MyError and handle it in the rescue block but it seems that kemals own handler catches it before me
Sadin has quit [Ping timeout: 260 seconds]
fka has joined #crystal-lang
Philpax has quit [Ping timeout: 276 seconds]
tomchapin has quit [Read error: Connection reset by peer]
srenatus has quit [Quit: Connection closed for inactivity]
Excureo has joined #crystal-lang
tomchapin has joined #crystal-lang
pawnbox has joined #crystal-lang
fka has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 272 seconds]
greengriminal has quit [Quit: Leaving]
<jokke> ah never mind, found out about Kemal.config.error_handler
Philpax has joined #crystal-lang
wminor_ has joined #crystal-lang
jwaldrip_ has joined #crystal-lang
guilleiguaran___ has joined #crystal-lang
Kilo`byte has joined #crystal-lang
Cidan has quit [*.net *.split]
ssvb has quit [*.net *.split]
toydestroyer has quit [*.net *.split]
x0f has quit [*.net *.split]
jwaldrip has quit [*.net *.split]
AckZ has quit [*.net *.split]
Kilobyte22 has quit [*.net *.split]
wminor has quit [*.net *.split]
danzilio has quit [*.net *.split]
guilleiguaran__ has quit [*.net *.split]
x0f has joined #crystal-lang
wminor_ is now known as wminor
jwaldrip_ is now known as jwaldrip
Liothen has joined #crystal-lang
Liothen has quit [Changing host]
Liothen has joined #crystal-lang
Cidan has joined #crystal-lang
guilleiguaran___ is now known as guilleiguaran__
danzilio has joined #crystal-lang
ssvb has joined #crystal-lang
AckZ has joined #crystal-lang
toydestroyer has joined #crystal-lang
toydestroyer is now known as Guest25024