RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.27.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
smurfendrek123 has joined #crystal-lang
<smurfendrek123> Hello, is this a valid way of overloading the initialize method? https://bpaste.net/show/ecc673697f33 I get the error: Error in src/Db.cr:221: wrong number of arguments for 'Db::StringColumn.new' (given 1, expected 0) Overloads are: - Reference.new()
<smurfendrek123> Can abstract classes have constructors defined if all values are defined in the abstract class? Or do i need to define those in the deriving classes?
Creatornator has joined #crystal-lang
<FromGitter> <Blacksmoke16> do you have the full example?
<smurfendrek123> Yes
sagax has quit [Quit: Konversation terminated!]
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/cr would be best as well
<smurfendrek123> Example of where I actually try to make a StringColumn is at the bottom
<FromGitter> <Blacksmoke16> well you're not inheriting your `Column`
<smurfendrek123> That's a very good point
<FromGitter> <Blacksmoke16> plus rest are classes while that one is a struct
<smurfendrek123> Nice that works!
<FromGitter> <Blacksmoke16> np
<smurfendrek123> Yea i changed StringColumn to a struct
<smurfendrek123> Thanks!
<FromGitter> <Blacksmoke16> np
smurfendrek123 has quit [Remote host closed the connection]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
<FromGitter> <ravage> Hello! I'm trying to figure out why the read_byte never gets to nil in the simple TCPServer example https://bpaste.net/show/18d0c952ef77
<FromGitter> <ravage> Am i missing something obvious?
johndescs has quit [Ping timeout: 240 seconds]
johndescs has joined #crystal-lang
<FromGitter> <wontruefree> can you check if the client has closed the connection?
<FromGitter> <ravage> Yes, the connection stays open
<FromGitter> <ravage> https://bpaste.net/show/b53067479a9a <- using this client for testing
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
return0e_ has joined #crystal-lang
chemist69 has quit [Ping timeout: 252 seconds]
return0e has quit [Ping timeout: 252 seconds]
chemist69 has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
olbat has quit [Ping timeout: 252 seconds]
daemonwrangler has quit [Ping timeout: 246 seconds]
olbat has joined #crystal-lang
Creatornator has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
crystal-lang564 has joined #crystal-lang
notdaniel has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
notdaniel has quit [Quit: Leaving]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
DTZUZO has quit [Ping timeout: 268 seconds]
marmotini_ has joined #crystal-lang
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #crystal-lang
<FromGitter> <straight-shoota> @ravage `read_byte` only returns nil when there is no more data to read, i.e. the connection is closed. Unless you close the connection, it will block until it can read.
<FromGitter> <ravage> @straight-shoota I see your point, but shouldn't it return nil when the IO is depleted?
<FromGitter> <straight-shoota> A socket is only depleted when it's closed.
<FromGitter> <ravage> So, without any end marker there is no way to know we have hit the end=
<FromGitter> <ravage> "normal" behavior is to get null or 0 (read(Bytes)) when there is nothing more to read
<FromGitter> <ravage> even with the socket open
<FromGitter> <ravage> At least that's the behavior i get in other languages
_whitelogger has joined #crystal-lang
DTZUZO has joined #crystal-lang
<FromGitter> <ravage> Thank you for taking the time to reply.
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter> <straight-shoota> There are different approaches to modelling IO streams. Crystal uses blocking IO. If you want to read from a socket and the buffer is empty, execution of the current fiber stops and it is only resumed when there is data to read. If that wasn't the case (like in the BSD-style socket API Crystal's `Socket` class is based upon), in order to read from a socket, the user would need to make sure that the
<FromGitter> ... socket has received the data it wants to read and otherwise make the program wait for it.
<FromGitter> <straight-shoota> > there is no way to know we have hit the end? ⏎ ⏎ Socket's don't have any concept of an end of stream, except for closing the socket.
<FromGitter> <straight-shoota> Application protocols often include some kind of end markers or length delimiter, but they're built on top of basic IO streams.
<FromGitter> <ravage> Yes, thank you, i was looking at it the wrong way and expecting behavior like a file read. Wasn't contemplating the fact of a persistent connection. Thank you again for the help, now i see my error
sagax has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
Creatornator has joined #crystal-lang
Raimondii has joined #crystal-lang
wmoxam_ has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
snapcase has quit [*.net *.split]
gangstacat has quit [*.net *.split]
RX14 has quit [*.net *.split]
Raimondi has quit [*.net *.split]
wmoxam has quit [*.net *.split]
Flipez has quit [*.net *.split]
literal has quit [*.net *.split]
Raimondii is now known as Raimondi
Flipez has joined #crystal-lang
Creatornator has joined #crystal-lang
gangstacat has joined #crystal-lang
crystal-lang564 has quit [Ping timeout: 258 seconds]
<FromGitter> <Blacksmoke16> https://github.com/Blacksmoke16/athena/issues/9 For the EU people, if anyone has any feedback
<FromGitter> <Blacksmoke16> RFC to help me figure out how to best develop CORS for athena
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ruimiguel has joined #crystal-lang
<jokke> hey, i'm trying to write a fairly simple webapp that allows people to share files. It basically just copies from the request body of one request to the response of another
<jokke> however during the transfer the process is running with 100% cpu usage
<jokke> which seems odd
<jokke> since it's io bound
<jokke> here's the code: https://p.jokke.space/8Gfz/
<jokke> it reaches an average speed of roughly 60MiB/s
<jokke> when built with --release
<jokke> without --release i'm at < 14MiB/s
marmotini_ has quit [Ping timeout: 250 seconds]
Creatornator has joined #crystal-lang
sz0 has joined #crystal-lang
ruimiguel has quit [Quit: leaving]
elfryskai has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jokke> hm another thing: during the transfer i can't make any requests
<jokke> it just blocks
<jokke> i thought HTTP::Server was using spawn
<jokke> ok adding a Fiber.yield in the read method on every 5th slice allows concurrent requests
<jokke> has anyone figured out why crystal programs run in docker scratch image can't be killed with sigterm?
RX14 has joined #crystal-lang
elfryskai has quit [Remote host closed the connection]
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
crystal-lang564 has joined #crystal-lang
rohitpaulk has joined #crystal-lang
Yxhuvud has quit [Remote host closed the connection]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
Yxhuvud has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
<FromGitter> <straight-shoota> > ok adding a Fiber.yield in the read method on every 5th slice allows concurrent requests ⏎ ⏎ That sounds weird. `IO.copy` calls `#read_bytes` which should block and yield the fiber if it can't read directly...
<FromGitter> <straight-shoota> Oh, wait. That's the issue.
<FromGitter> <straight-shoota> You're not delegating `#read_bytes` so it reads every single byte using `#read`.
<FromGitter> <straight-shoota> jokke ^^
<FromGitter> <straight-shoota> Wait, no I confused these methods
<FromGitter> <straight-shoota> That's not it.
<FromGitter> <straight-shoota> But maybe there is some other reason that `Share < IO` causes issues because you don't delegate some efficiently (buffered) methods. Why are you using inheritance anyway?
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
crystal-lang564 has quit [Quit: Konversation terminated!]
beepdog has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
<FromGitter> <Blacksmoke16> https://github.com/Blacksmoke16/athena/issues/9#issuecomment-472179344 came up with another option for CORs
<FromGitter> <Blacksmoke16> now the question is which is better...
<FromGitter> <bew> Good luck with that 😁
<FromGitter> <Blacksmoke16> 😢
<FromGitter> <Blacksmoke16> im leaning towards option 2
<FromGitter> <Blacksmoke16> :shrug:
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
moei has joined #crystal-lang
<FromGitter> <j8r> I noticed that sourceforge is down https://sourceforge.net/ when developing on an Alpine aport
<FromGitter> <j8r> they said due to a DDOS
<FromGitter> <j8r> Minetest 5.0.0 is out :D https://github.com/minetest/minetest/releases
<FromGitter> <Blacksmoke16> looks like minecraft
<FromGitter> <j8r> yes, it's a better clone
<FromGitter> <j8r> with server side lua mods, better perf, no bloc limit
snapcase has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
<FromGitter> <vladfaust> Do Crystal forked processes support inproc:// transport?
olbat[m] has joined #crystal-lang
devil_tux has joined #crystal-lang
<devil_tux> guys .. need help :< doc = XML.parse(base_data); doc.children.select(&.element?).each do |child| -> how do I edit on <child> as a working copy of `doc`
laaron has quit [Remote host closed the connection]
<devil_tux> anyone up? eh :sweat_smile:
laaron has joined #crystal-lang
<FromGitter> <vladfaust> For, example, https://crystal-lang.org/api/0.27.2/XML/Node.html#content%3D%28content%29-instance-method