<FromGitter>
<jwoertink> Oh, you're talking about ruby's `Kernel.exec`?
<FromGitter>
<jwoertink> something in crystal like that?
dannluciano has joined #crystal-lang
<adam12>
@jwoertink Yes. I'd like to *replace* the current process. fork and exec, if you know that pattern.
dannluciano has quit [Ping timeout: 260 seconds]
<FromGitter>
<jwoertink> Well, you could use `Process.fork` and the `system` method. I've never really used that pattern though, so I'm not sure if that's the same or not
snsei has joined #crystal-lang
<FromGitter>
<jwoertink> Hey all, I have my first iteration of Fez just about done. https://github.com/jwoertink/fez I'd like to get some feedback on it. If anyone has a project to start, let me know if you run in to errors. Feel free to post in issues.
soveran has joined #crystal-lang
pawnbox has joined #crystal-lang
soveran has quit [Ping timeout: 276 seconds]
willl has quit [Quit: Connection closed for inactivity]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
nakilon has quit [Ping timeout: 244 seconds]
snsei has joined #crystal-lang
snsei_ has quit [Ping timeout: 240 seconds]
dannluciano has joined #crystal-lang
dannluciano has quit [Ping timeout: 240 seconds]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 258 seconds]
pawnbox has quit [Ping timeout: 260 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 276 seconds]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
onethirtyfive has joined #crystal-lang
onethirtyfive has quit [Read error: Connection reset by peer]
onethirtyfive has joined #crystal-lang
soveran has joined #crystal-lang
dannluciano has joined #crystal-lang
soveran has quit [Ping timeout: 240 seconds]
snsei_ has joined #crystal-lang
dannluciano has quit [Ping timeout: 240 seconds]
snsei has quit [Read error: Connection reset by peer]
soveran has quit [Remote host closed the connection]
<FromGitter>
<jwoertink> @BlaXpirit Thanks for the suggestion on the exec, @adam12 was looking for something like ruby's Kernel.exec. Looks like Process.run would work
<adam12>
@jwoertink I am pretty sure Process.run already uses execvp under the hood. Not sure what the change would be to convert it into Kernel.exec style.
<FromGitter>
<jwoertink> I'm not too sure either. I've never had a reason to use it. Are you trying to write something like spork?
<adam12>
@jwoertink Something like Godrb, if you are from Ruby land.
<FromGitter>
<jwoertink> oh so process monitoring?
<FromGitter>
<jwoertink> yup, I grew up in ruby land :D
<adam12>
@jwoertink Yeah, I need something to replace runit for my Ruby apps. I thought I'd roll my own non-memory-leaking-Godrb. LOL.
<FromGitter>
<jwoertink> LOL! Yeah, I was gonna say, god really didn't work that well. I usually use monit, (which also has a ton of issues)
<FromGitter>
<jwoertink> plus, trying to google for "god kill workers" was really tough
<adam12>
@jwoertink I use monit as well, but not for running applications. I feel like I want something similar to `pm2` from node land, but without node :) Something where Joe-user can manage processes themselves. No sudo, no systemd, no upstart, etc.
<adam12>
That accepts a Procfile and knows what to do with it, but isn't full on Docker/Dokku/whatever.
<FromGitter>
<jwoertink> so like foreman?
pawnbox_ has joined #crystal-lang
pawnbox has quit [Read error: Connection reset by peer]
soveran has joined #crystal-lang
<adam12>
Foreman is closer? But I want to daemonize it and then communicate over sockets.
<adam12>
And maybe support multiple apps. I dunno.
<FromGitter>
<jwoertink> that would be nice. Foreman has a tendency to not release ports when stopped
<FromGitter>
<jwoertink> multiple apps is already supported
<FromGitter>
<jwoertink> In foreman, you can link to other procfiles from a main one
<adam12>
I didn't know that. I woudl say foreman is close, but pm2 likely closer.
<tilpner>
Huh, that's not as pretty... &->Item.new(XML::Node) works, but is hardly any better.
<tilpner>
Thanks though. :/
<FromGitter>
<jwoertink> Not sure what Item is, but you could do something like how rails works with models, and do `items = Item.new(entry_xml.children)`
<FromGitter>
<jwoertink> make it take an array or a single element
<FromGitter>
<jwoertink> and because crystal is awesome and does method overloading, you can have two initialize :D
fryguy9 has joined #crystal-lang
fryguy9 has quit [Client Quit]
<asterite>
I don't think `{ |x| Item.new x }` is ugly
<asterite>
and if you try to make it prettier it'll probably turn uglier