Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 04:54
    aarongodin synchronize #11765
  • 04:52
    aarongodin synchronize #11765
  • 04:42
    aarongodin synchronize #11765
  • Jan 24 18:25
    straight-shoota labeled #11765
  • Jan 24 18:25
    straight-shoota labeled #11765
  • Jan 24 18:20
    FnControlOption synchronize #11476
  • Jan 24 18:06
    aarongodin opened #11765
  • Jan 24 17:42
    straight-shoota synchronize #11563
  • Jan 24 17:39
    FnControlOption synchronize #11476
  • Jan 24 17:05
    asterite closed #11756
  • Jan 24 14:30
    straight-shoota synchronize #11563
  • Jan 23 16:04
    HertzDevil labeled #11764
  • Jan 23 16:04
    HertzDevil opened #11764
  • Jan 23 16:04
    HertzDevil labeled #11764
  • Jan 23 15:34
    HertzDevil labeled #11763
  • Jan 23 15:34
    HertzDevil labeled #11763
  • Jan 23 15:34
    HertzDevil opened #11763
  • Jan 23 15:20
    HertzDevil labeled #11761
  • Jan 23 15:10
    HertzDevil labeled #11762
  • Jan 23 15:10
    HertzDevil labeled #11762
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
Rishav Sharan
@rishavs
does anyone here uses Sublime Text 4 for crystal dev work? How is the IDE support on sublime. I see that the sublime plugin calls out support for only 2/3 and has fairly slow development.
I am having issues with VS Code and was thinking of trying out alternatives
From IRC (bridge bot)
@FromIRC
<Guest12> Hi all. I am wondering if anyone has a suggestion for creating cross platform UI. I need to target Android specifically so I thought web base would be logical. Although I don't want to touch html/CSS etc. I was hoping there would be a way to make, say imgui, accessable to an android client via http or the like.
<Guest12> Or if any of the current web frameworks for crystal have a built in UI builder that is able to be constructed from within crystal.
From IRC (bridge bot)
@FromIRC
<jhass[m]> you gonna have a hard time with crystal there right now honestly, also because for Android 32 bit ARM is still a relevant target and not even our 64 bit ARM support is in perfect shape
<jhass[m]> Have a look at Flutter maybe
Chris Watson
@watzon
@rishavs VS Code currently has the best Crystal support. It's not stellar, but that's more a lack of a decent language server than anything.
From IRC (bridge bot)
@FromIRC
<ua_> he waited whole 6.5 minutes lmao
George Dietrich
@Blacksmoke16
hm?
From IRC (bridge bot)
@FromIRC
<ua_> i mean Guest12
<ua_> and he should just use react / react native if anyone cares about answer to his question lol
Daniel Worrall
@Daniel-Worrall
Oh, did he leave the irc?
From IRC (bridge bot)
@FromIRC
<ua_> no html/css sure, sadly its the world we live in
Chris Watson
@watzon
He said he didn't want to touch HTML/CSS
From IRC (bridge bot)
@FromIRC
<ua_> yeah
Chris Watson
@watzon
Flutter is the way imo
Daniel Worrall
@Daniel-Worrall
Flutter is nice
Rishav Sharan
@rishavs
flutter is indeed his best bet
George Dietrich
@Blacksmoke16
just return JSON
who needs a UI
Chris Watson
@watzon
++
UIs are for chumps
George Dietrich
@Blacksmoke16
ascii art formatted tables
Chris Watson
@watzon
Just emulate VIM
Rishav Sharan
@rishavs
just hire mimes to read the json and act on it
aaaScript
@aaaScript

@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

@didactic-drunk It returns socket output after bind_tls and listen as expected. However, it just seems to get wiped like you mentioned. It's kind of weird. I'm not overwriting the object or anything.

ddd
@Dan-Do
@Guest12 you can try Mint
Quinton Miller
@HertzDevil
libpcre reached end-of-life
Ali Naqvi
@naqvis
log back ago, I commented to migrate to pcre2, but ...
https://github.com/crystal-lang/crystal/issues/8199#issuecomment-533171075
Alex Kampa
@alex-kampa
h = Hash(String, String | Hash(String, String)).from_json(jmsg)

results in a compile-time type of

(Hash(String, Hash(String, String) | String) | Nil)

which measn that h.keys throws an error. How can I force h to be a hash?

ie never Nil
Is using is_a? the only way?