Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 20:55
    straight-shoota milestoned #12814
  • 20:55
    straight-shoota milestoned #12814
  • 19:40
    straight-shoota closed #12812
  • 19:35
    straight-shoota closed #12782
  • 19:34
    straight-shoota closed #12818
  • 19:34
    straight-shoota closed #12824
  • 13:49
    Blacksmoke16 labeled #12825
  • 07:05
    naqvis labeled #12825
  • 07:05
    naqvis opened #12825
  • 02:47
    Blacksmoke16 reopened #8468
  • 02:45
    Blacksmoke16 closed #8468
  • Dec 06 13:16
    straight-shoota milestoned #12824
  • Dec 06 13:16
    straight-shoota milestoned #12824
  • Dec 06 13:07
    straight-shoota edited #11555
  • Dec 06 11:30
    straight-shoota milestoned #12782
  • Dec 06 11:30
    straight-shoota milestoned #12782
  • Dec 06 09:51
    BlobCodes synchronize #12687
  • Dec 06 09:34
    caspiano labeled #12824
  • Dec 06 09:34
    caspiano opened #12824
  • Dec 06 09:34
    caspiano labeled #12824
George Dietrich
@Blacksmoke16
idt you can without some macro magic
and i doubt that'd idea would fly
From IRC (bridge bot)
@FromIRC
<postmodern> can you define class variables in modules?
George Dietrich
@Blacksmoke16
yes
From IRC (bridge bot)
@FromIRC
<postmodern> such that when the module is extended into a class, it's class variables are defined in the class not the module
George Dietrich
@Blacksmoke16
mm would have to test it
otherwise could maybe make use of like macro extended
From IRC (bridge bot)
@FromIRC
<postmodern> would i have to define the the class variable type inside of a macro extended ?
<postmodern> yeah
<postmodern> ah that works, now i have another error from the specs
From IRC (bridge bot)
@FromIRC
<postmodern> is there a constant for the new-line character/string? "\n" on *nix "\r\n" on windows?
George Dietrich
@Blacksmoke16
dont think so
From IRC (bridge bot)
@FromIRC
<yxhuvud> That'd be nice to have though.
<yxhuvud> might be a mess though. There there still other systems that use "\n\r" ?
From IRC (bridge bot)
@FromIRC
<kevinsjoberg> didn't realize Freenode went ape-shit crazy and banned anyone using IRCCloud. Thank god we moved to Libera.
From IRC (bridge bot)
@FromIRC
<jhass[m]> it's worse, they deleted their entire channel and userdb. It's a new network squatting the old name
Håkan Nylén
@confact
What makes HTTP::Client.get(url).body_io not work when HTTP::Client.get(url).body works? I want to reduce memory somehow, trying to download big files ^^
From IRC (bridge bot)
@FromIRC
<jhass[m]> there's an issue around this somewhere, the interface is just a bit shitty. You want to use the block variant to access body_io, HTTP::Client.get(url) { |response| File.open("dest") {|f| IO.copy(response.body_io, f) } }
Håkan Nylén
@confact
Ah, thanks. Will test it.
Yea, reduced the memory by 60% with that line of code, thanks @jhass[m].
Gabor Szabo
@szabgab
What is the name of the syntax when the condition comes after the statement? (e.g. break if x > 3) in Perl this is called statement modifier, but I don't know how it is called in Crystal
Gabor Szabo
@szabgab
Thanks
From IRC (bridge bot)
@FromIRC
<mps> is http gracefull shutdown solved (we talked here about it two years ago, iirc)
<mps> (would be nice to remove 'reference' counting from my http servers)
From IRC (bridge bot)
@FromIRC
<straight-shoota> Not sure what was the status back then, but should be mostly solved
<straight-shoota> When you close an HTTP::Server, it shuts down the accept sockets and no new clients will be received. But existing connections continue to be worked.
From IRC (bridge bot)
@FromIRC
<mps> @straight-shoota: ah, thanks. will test it again
<mps> I missed to read that in changes
From IRC (bridge bot)
@FromIRC
<mps> huh, it still doesn't work
<mps> here is my test code https://tpaste.us/xnWw
didactic-drunk
@didactic-drunk
I think the issue is not with the accept socket but lack of tracking already accepted sockets
From IRC (bridge bot)
@FromIRC
<mps> iiuc the problem is in server.closed?
<mps> uh, no
<mps> I had link how to do this in golang but lost this link
didactic-drunk
@didactic-drunk
close. closes the listening sockets. The main fiber waits for all listening sockets to close then exits. It doesn't wait for fibers handling client connections
So it's "half" graceful
From IRC (bridge bot)
@FromIRC
<mps> maybe I need to add Fiber.yield
<mps> hm no, Fiber.yield didn't helped
<mps> have to dig old example on archive disk
<mps> but also have to finish irssi rewrite rules for this channel
From IRC (bridge bot)
@FromIRC
<mps> perl greedy matches make me ... uff
<mps> yes, it should close listening socket but not active ones
didactic-drunk
@didactic-drunk
@mps could you test #10884 and see if it fixes your problem?
Francisco Adasme
@franciscoadasme
hey everyone, is there a way to declare a subtype of a typevar (T::U) in a type restriction?, something like this:
struct Foo; end
struct Foo::Bar; end

module A(T)
  abstract def bar : T::Bar
end

class B
  include A(Foo)

  def bar : Foo::Bar
    Foo::Bar.new
  end
end
George Dietrich
@Blacksmoke16
include A(Foo::Bar)
and just use T
From IRC (bridge bot)
@FromIRC
<mps> @didactic-drunk: I have to rebuild crystal for this, iiuc
didactic-drunk
@didactic-drunk
You could possibly use an existing 1.0.0 build
From IRC (bridge bot)
@FromIRC
<mps> I don't keep it around because my arm64 machines are too slow to build crystal