Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 21:54
    straight-shoota milestoned #12377
  • 21:11
    straight-shoota closed #12355
  • 18:26
    straight-shoota closed #12351
  • 18:26
    straight-shoota closed #12374
  • 17:19
    Blacksmoke16 labeled #12377
  • 17:19
    Blacksmoke16 labeled #12377
  • 17:15
    dscottboggs opened #12377
  • 16:26
    Blacksmoke16 closed #8093
  • 16:26
    Blacksmoke16 labeled #8093
  • 15:48
    Blacksmoke16 labeled #12376
  • 15:48
    Blacksmoke16 labeled #12376
  • 15:20
    straight-shoota milestoned #12374
  • 15:20
    wontruefree opened #12376
  • 15:20
    wontruefree labeled #12376
  • 14:53
    asterite labeled #12375
  • 14:53
    asterite labeled #12375
  • 14:53
    asterite opened #12375
  • 13:04
    asterite synchronize #12374
  • 12:47
    straight-shoota milestoned #12355
  • 12:20
    asterite labeled #12374
didactic-drunk
@didactic-drunk
You can probably use an existing compiled 1.0.0 crystal binary with the std lib source from my branch (or just copy http/server.cr)
From IRC (bridge bot)
@FromIRC
<mps> ah, lets see
From IRC (bridge bot)
@FromIRC
<mps> @didactic-drunk: In /usr/lib/crystal/core/http/server.cr:505:9
<mps> 505 | sleep timeout
<mps> Error: no overload matches 'sleep' with type Nil
<mps> but looking into patch, this is some kind of reference counting also?
didactic-drunk
@didactic-drunk
Did you use close with or without a timeout?
From IRC (bridge bot)
@FromIRC
<mps> without timeout, I want to close listening socket imediately
didactic-drunk
@didactic-drunk
Try close timeout: 0
Um. Listening sockets are closed immediately regardless of timeout. Timeout is the wait time for already accepted client connections
From IRC (bridge bot)
@FromIRC
<mps> yes, patch didn't helped
didactic-drunk
@didactic-drunk
Try timeout: 80
From IRC (bridge bot)
@FromIRC
<mps> will this close listening socket imediately?
<mps> even with 'timeout: 80' doesn't work
didactic-drunk
@didactic-drunk
It should
From IRC (bridge bot)
@FromIRC
<mps> dies immediately
didactic-drunk
@didactic-drunk
Do you have a client connection open before ctrl+c?
From IRC (bridge bot)
@FromIRC
<mps> yes
didactic-drunk
@didactic-drunk
Works on my end
With your test code
From IRC (bridge bot)
@FromIRC
<mps> hm
<mps> ok, thanks
Francisco Adasme
@franciscoadasme
@Blacksmoke16 ok, thanks
From IRC (bridge bot)
@FromIRC
<mps> I will try to build crystal with your patch on weekend and test again
didactic-drunk
@didactic-drunk
Can you test on non-arm?
From IRC (bridge bot)
@FromIRC
<mps> I can, but maybe next week (ditched x86 few years ago)
<mps> hmm, maybe I can 'usurp' my alpine developers lxc
<mps> but not now, it is to busy by building a lot of pkgs now
didactic-drunk
@didactic-drunk
Nm. It's possible it needs crystal master although I don't see why. I hope it's not an arm thing
From IRC (bridge bot)
@FromIRC
<mps> last time I tried it was same on arm and x86
From IRC (bridge bot)
@FromIRC
<postmodern> is there a way to create an tuple of arbitrary length, but all elements are of the same type?
George Dietrich
@Blacksmoke16
No tuples are fixed suze by design
Size
Chris Watson
@watzon
Is there a good thread safe queue yet?
Or am I going to have to implement one quickly?
George Dietrich
@Blacksmoke16
Rabbit?
Chris Watson
@watzon
Rabbit would probably be a good idea actually, but this is a smaller project and I'd rather avoid external deps like that if I can. I really just need a deque that is thread safe.
George Dietrich
@Blacksmoke16
That's fair
There's one in the stdlib, but idk if it's thread safe or not
Chris Watson
@watzon
Yeah iirc it isn't
From IRC (bridge bot)
@FromIRC
<yxhuvud> @watzon: can you use a channel?
Quinton Miller
@HertzDevil
is there a design reason that x.as?(T) isn't equivalent to x if x.is_a?(T)
(the difference is that the former returns a T? and the latter returns a (typeof(x) & T)?)
From IRC (bridge bot)
@FromIRC
<yxhuvud> subclasses?
Quinton Miller
@HertzDevil
why do you think so
From IRC (bridge bot)
@FromIRC
<yxhuvud> no good reason.
From IRC (bridge bot)
@FromIRC
<yxhuvud> looking at the documentation for as, I guess the upcast possibility to union type could be responsible?
From IRC (bridge bot)
@FromIRC
<yxhuvud> ie it allows you to do things like [1.as?(Int32|String)] << "hello" which is not possible using 1 if 1.is_a?(Int32|String) instead
Quinton Miller
@HertzDevil
oh yeah upcasts
what about x.as?(T) versus x.as(T) if x.is_a?(T)