Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 06 21:20
    HertzDevil synchronize #10805
  • Jul 06 21:14
    straight-shoota edited #5430
  • Jul 06 20:20
    beta-ziliani closed #12146
  • Jul 06 20:20
    beta-ziliani synchronize #12146
  • Jul 06 20:02
    HertzDevil review_requested #12089
  • Jul 06 19:41
    HertzDevil synchronize #11647
  • Jul 06 19:19
    HertzDevil synchronize #11647
  • Jul 06 19:18
    HertzDevil labeled #12213
  • Jul 06 19:18
    HertzDevil labeled #12213
  • Jul 06 19:18
    HertzDevil labeled #12213
  • Jul 06 19:18
    HertzDevil opened #12213
  • Jul 06 18:24
    beta-ziliani synchronize #12146
  • Jul 06 17:38
    HertzDevil synchronize #12212
  • Jul 06 17:02
    HertzDevil labeled #12212
  • Jul 06 17:02
    HertzDevil labeled #12212
  • Jul 06 17:02
    HertzDevil labeled #12212
  • Jul 06 17:02
    HertzDevil opened #12212
  • Jul 06 13:42
    beta-ziliani ready_for_review #12146
  • Jul 06 13:41
    beta-ziliani milestoned #12146
  • Jul 06 13:38
    beta-ziliani synchronize #12146
From IRC (bridge bot)
@FromIRC
<yxhuvud> straight-shoota: I wouldn't mind moving Scheduler#yield to a event loop dependent place though. I don't know about how it would work on windows but at least for uring it makes no sense to set up a timer instead of using a NOP op.
<yxhuvud> assuming there is even need to emit an op in the first place, which is questionable.
<straight-shoota> @rishavs, Windows is not exactly made for signals. We'll probably be able to imitate a few of them, but you shouldn't expect that to work as on posix systems
<straight-shoota> More info on crystal-lang/crystal#7339
<straight-shoota> yxhuvud, yeah, that's probably a good idea. Fiber.yield == sleep 0 is an implementation detail of the event loop
Rishav Sharan
@rishavs
:heart:

I just want crystal on windows so I can do some gamejams using crsfml ^_^. I am not interested in the networking bits, just hate the effort it requires to set up crystal on windows currently.
I would be happy if I can just do scoop install crystal and the compiler after installation throws a big honking text Networking is currently not supported on windows platform.

Anyway, wanted to thank you and the rest of the team on picking more big rocks on the windows side of things.

Quinton Miller
@HertzDevil
does crystal have the capability to distinguish between prelude code and user code in build artifacts
mainly asm and llvm-ir
From IRC (bridge bot)
@FromIRC
<yxhuvud> what functions would be part of the prelude?
Rishav Sharan
@rishavs
Any sneak peak on the 1.10 changelog?
Rishav Sharan
@rishavs
Thanks @jhass:m.aeshna.de !
manveru
@manveru:matrix.org
[m]
hi folks, i'm trying to parse a stream of rather large json objects without any delimiters between them from an IO... is there some sane way to do that
the only way i've found so far would be to use the JSON::PullParser and manually try to parse everything... or maybe going through the stream and counting braces, but that's also error-prone because of escaping
George Dietrich
@Blacksmoke16
can you alter the source to make them at least on unique lines?
manveru
@manveru:matrix.org
[m]
unfortunately not, i'm consuming a 3rd party api for streaming events
hmm, lemme double-check that though
ok, i must've made some mistake, it seems a simple gets on the io with a huge buffer works :)
manveru
@manveru:matrix.org
[m]
and each_line is even more elegant
George Dietrich
@Blacksmoke16
so they are delimited then?
manveru
@manveru:matrix.org
[m]
i tried IO::Delimited first, but that was probably wrong
sure looks like there are proper newlines in there, yeah
sorry for the disturbance ^^;
Quinton Miller
@HertzDevil
looking at the llvm ir and asm outputs, they do include source locations even without --debug which should be enough
because on compiler explorer there should most certainly be only one non-library source file, everything else would be considered "third-party" code
aaaScript
@aaaScript
Hi everyone. I have a quick question. Has anyone ever had an issue with closing a HTTP::Server's port when it is created in a fiber. I'll try to see if I can come up with some cleaned code but I'm basically creating an having a new HTTP Server listen while in a spawn block so that it doesn't block the rest of the program. Then later I'm trying to close it with the #close function outside of the spawn block later on. However despite that it still leaves the socket open and listening. I'm assuming it needs to be closed within the spawn block but I'm wondering if anyone has some insight on that.
From IRC (bridge bot)
@FromIRC
<straight-shoota> that should really make no difference
From IRC (bridge bot)
@FromIRC
<yxhuvud> just make certain the fiber is actually done with it before closing it in the original fiber
aaaScript
@aaaScript
Is there a good way to ensure that a a fiber is complete and able to be closed? Since the http server is stuck on listening, I'm not sure of a way to send a close command while it's in that state.
From IRC (bridge bot)
@FromIRC
<straight-shoota> HTTP::Server#close should do
aaaScript
@aaaScript
Oddly enough using that method doesn't seem to do anything. I'll try to see if I can replicate it in a small block of code for some more context.
From IRC (bridge bot)
@FromIRC
<straight-shoota> Well, it tries a graceful shutdown. If any requests are still being processed, they'll continue. Can you check if the close method returns or blocks?
oprypin
@oprypin:matrix.org
[m]

@rishavs:

I just want crystal on windows so I can do some gamejams using crsfml ^_^. I am not interested in the networking bits, just hate the effort it requires to set up crystal on windows currently.

i have to say, a one-time hurdle that takes up an hour at most doesn't seem reasonable to give up at, considering how big of a followup you're abstaining from.

aaaScript
@aaaScript

<straight-shoota> Well, it tries a graceful shutdown. If any requests are still being processed, they'll continue. Can you check if the close method returns or blocks?

The close method does return, yes.

However, the fiber running the listen method still blocks and doesn't let the fiber close.
From IRC (bridge bot)
@FromIRC
<straight-shoota> Hm, that's odd. Server#close should close all the listening sockets, so accept on them should fail at that point
aaaScript
@aaaScript
I think it seems to be extremely specific to my code and the use of Granite since I'm not able to replicate it into a smaller file. I'm creating HTTP::Server objects dynamically based on host/port attributes created from Granite models. I think that is causing some weird issues. I'll try to look into it and report back if I determine anything from it.
didactic-drunk
@didactic-drunk
@aaaScript 1) Are you using -Dpreview_mt? 2) After .close what is the socket listen state? Can you check with netstat -ln?
aaaScript
@aaaScript
I am not. Also after running netstat the socket is still in a LISTEN state.
didactic-drunk
@didactic-drunk
Are you closing the socket directly or via http.close?
If you're closing the socket directly the bug is fixed in master
aaaScript
@aaaScript
I'm doing it via http.close. I'll try to dissect it some more or play with different ways of closing it.
didactic-drunk
@didactic-drunk
Before and after close
p http.@sockets.map(&.closed?)
p http.@sockets # or
Quinton Miller
@HertzDevil
anyone want to try out compiler-explorer/compiler-explorer#2732 locally
Ali Naqvi
@naqvis
Thank you @HertzDevil :thumbsup:
needing some help here
aaaScript
@aaaScript

Before and after close

p http.@sockets.map(&.closed?)
p http.@sockets # or

@didactic-drunk it's actually returning empty arrays for me before and after. It's kind of odd. Maybe something is happening after the #listen method that is causing some issue?

# Before Close
[]
[]
# After Close
[]
[]
didactic-drunk
@didactic-drunk
@aaaScript Empty @sockets explains why close doesn't work. p @sockets before & after bind & listen(). The array probably gets nuked after listen or it wouldn't accept connections at all