capfredf has quit [Remote host closed the connection]
capfredf has joined #racket
monkey_ has quit [Remote host closed the connection]
capfredf has quit [Ping timeout: 256 seconds]
monkey_ has joined #racket
casmajavi has quit [Quit: Leaving]
capfredf has joined #racket
capfredf has quit [Remote host closed the connection]
capfredf has joined #racket
capfredf has quit [Ping timeout: 272 seconds]
TCZ has joined #racket
s-liao has quit [Quit: Client closed]
capfredf has joined #racket
capfredf has quit [Ping timeout: 245 seconds]
TCZ has quit [Quit: Leaving]
badkins has quit [Remote host closed the connection]
Psybur has quit [Remote host closed the connection]
monkey_ has quit [Remote host closed the connection]
s-liao has joined #racket
skapata has quit [Ping timeout: 260 seconds]
s-liao91 has joined #racket
s-liao has quit [Ping timeout: 256 seconds]
badkins has joined #racket
badkins has quit [Ping timeout: 250 seconds]
monkey_ has joined #racket
monkey_ has quit [Remote host closed the connection]
monkey_ has joined #racket
badkins has joined #racket
capfredf has joined #racket
badkins has quit [Ping timeout: 240 seconds]
s-liao91 has quit [Quit: Client closed]
notzmv has quit [Remote host closed the connection]
monkey_ has quit [Ping timeout: 272 seconds]
capfredf has quit [Remote host closed the connection]
capfredf has joined #racket
notzmv has joined #racket
capfredf has quit [Ping timeout: 256 seconds]
capfredf has joined #racket
capfredf has quit [Ping timeout: 260 seconds]
zostj has joined #racket
zostj has quit [Client Quit]
zostj has joined #racket
zostj has quit [Quit: WeeChat 3.4]
cynomys has quit [Quit: leaving]
badkins has joined #racket
badkins has quit [Ping timeout: 256 seconds]
zostj has joined #racket
badkins has joined #racket
badkins has quit [Ping timeout: 250 seconds]
gproto23 has joined #racket
gproto23 has quit [Ping timeout: 272 seconds]
notzmv has quit [Ping timeout: 260 seconds]
zostj has quit [Quit: WeeChat 3.4]
zostj has joined #racket
zostj has quit [Quit: WeeChat 3.4]
s-liao has joined #racket
zostj has joined #racket
zostj has quit [Client Quit]
zostj has joined #racket
badkins has joined #racket
badkins has quit [Ping timeout: 256 seconds]
s-liao has quit [Quit: Client closed]
s-liao has joined #racket
rgherdt_ has joined #racket
rgherdt has quit [Read error: Connection reset by peer]
capfredf has joined #racket
capfredf has quit [Ping timeout: 245 seconds]
Everything has joined #racket
gproto23 has joined #racket
notzmv has joined #racket
s-liao has quit [Quit: Client closed]
parnikkapore has joined #racket
s-liao has joined #racket
casmajavi has joined #racket
casmajavi has quit [Client Quit]
capfredf has joined #racket
capfredf has quit [Remote host closed the connection]
capfredf has joined #racket
capfredf has quit [Remote host closed the connection]
capfredf has joined #racket
capfredf has quit [Ping timeout: 250 seconds]
gproto23 has quit [Ping timeout: 256 seconds]
monkey_ has joined #racket
bryan has quit [Quit: WeeChat 1.4]
bryan has joined #racket
gproto23 has joined #racket
badkins has joined #racket
capfredf has joined #racket
badkins has quit [Ping timeout: 240 seconds]
badkins has joined #racket
capfredf has quit [Remote host closed the connection]
capfredf has joined #racket
Everything has quit [Quit: leaving]
<jA_cOp>
In a Racket script, how can I run some code on every minute or hour, kind of like cron? Like a kind of sleep/alarm where my main loop can continue at 00:00, 00:01 etc. In the manual search I found a `schedule-at` from `koyo/job` - should I be using this?
s-liao has quit [Quit: Client closed]
capfredf has quit [Ping timeout: 256 seconds]
<jA_cOp>
Hm, maybe I should use `alarm-evt`
skapata has joined #racket
skapata has quit [Changing host]
skapata has joined #racket
monkey_ has quit [Remote host closed the connection]
casmajavi has joined #racket
<jA_cOp>
ok cool, got it working with `alarm-evt`, although the date/time handling code is really ugly, if there's an elegant way to use `alarm-evt` to wake up at the start of every minute that would be nice
<tonyg>
jA_cOp there isn't anything in the standard library, I don't think. Having a nicely integrated cron/at-like facility would be awesome. Surprisingly few languages/language-runtimes offer such a feature despite it being so frequently needed!
badkins has quit [Remote host closed the connection]
<ns12>
tonyg: Isn't it just a simple matter of using the "alarm" system call and a SIGALRM handler?
<tonyg>
ns12: not generally, no. Usually, at the kernel level, you'd use something like select(2) or similar, and you'd have to manage a timeout priorityqueue yourself.
<tonyg>
SIGALRM is of limited applicability
lagash has quit [Ping timeout: 250 seconds]
<tonyg>
for many programs, having a simple timeout heap is enough. but when you want the cron/at-like functionality, that's where there's a surprising gap. Scheduled, possibly-repeating tasks. Integration between the raw timeout heap and a calendar facility. That kind of thing.
<ns12>
tonyg: How does select(2) relate to timers?
<tonyg>
ns12: it takes a `struct timeval *timeout` as its final parameter, allowing you to integrate blocking on timeouts with blocking on I/O. otherwise you have a hell of a job trying to multiplex those kinds of blocking
<ns12>
tonyg: "integrate blocking on timeouts with blocking on I/O" - Why would a cron facility need this integration?
badkins has joined #racket
badkins has quit [Remote host closed the connection]
badkins has joined #racket
parnikkapore has quit [Quit: Leaving]
badkins has quit [Ping timeout: 240 seconds]
casmajavi has quit [Remote host closed the connection]
capfredf has joined #racket
capfredf has quit [Ping timeout: 256 seconds]
<jA_cOp>
I'm guessing because you may want your program to wake up for other reasons than just the cron timers. From what I understand, `alarm-evt` with `sync` can already elegantly do this (cludgy time-handling code for cron-like behavior with `alarm-evt` notwithstanding)
capfredf has joined #racket
capfredf has quit [Remote host closed the connection]
badkins has joined #racket
capfredf has joined #racket
<tonyg>
Exactly. The challenge is to multiplex events from multiple sources.
badkins has quit [Ping timeout: 256 seconds]
lagash has joined #racket
capfredf has quit [Remote host closed the connection]
capfredf has joined #racket
capfredf has quit [Ping timeout: 272 seconds]
simendsjo has joined #racket
badkins has joined #racket
badkins has quit [Ping timeout: 240 seconds]
bryan has quit [Quit: WeeChat 1.4]
simendsjo has quit [Ping timeout: 240 seconds]
zostj has quit [Quit: WeeChat 3.4]
badkins has joined #racket
badkins has quit [Ping timeout: 240 seconds]
badkins has joined #racket
badkins has quit [Ping timeout: 240 seconds]
bryan has joined #racket
TCZ has joined #racket
capfredf has joined #racket
capfredf has quit [Ping timeout: 256 seconds]
AkechiShiro has quit [Ping timeout: 240 seconds]
AkechiShiro has joined #racket
badkins has joined #racket
badkins has quit [Ping timeout: 240 seconds]
gproto23 has quit [Remote host closed the connection]
badkins has joined #racket
xgqt has quit [Read error: Connection reset by peer]
TCZ has quit [Quit: Leaving]
badkins has quit [Ping timeout: 256 seconds]
xgqt has joined #racket
badkins has joined #racket
badkins has quit [Ping timeout: 250 seconds]
casmajavi has joined #racket
capfredf has joined #racket
badkins has joined #racket
capfredf has quit [Ping timeout: 240 seconds]
badkins has quit [Ping timeout: 240 seconds]
badkins has joined #racket
badkins has quit [Remote host closed the connection]
badkins has joined #racket
capfredf has joined #racket
capfredf has quit [Remote host closed the connection]
capfredf has joined #racket
capfredf has quit [Ping timeout: 272 seconds]
capfredf has joined #racket
capfredf has quit [Remote host closed the connection]