Skip to content

Conversation

@kstrafe
Copy link

@kstrafe kstrafe commented Nov 9, 2017

There is a need for semi-persistence in some cases. Especially threads may make use
of this functionality: the thread needs to be reloaded but its previous instance must
be killed. For this we need to persist the variable until after the reload and then
kill the thread

An example:

(make-persistent-state-destructor 'name (lambda () (thread (lambda ()
                                          (let loop ()
                                            (sleep 1)
                                            (displayln (current-seconds))
                                            (loop)))))
                                  kill-thread)

On my webserver I have a thread that performs certain IO operations periodically, however,
I want it to be reloaded (and the old instance killed) whenever I change a file. This would
be a very good addition to the library.

There is a need for semi-persistence in some cases. Especially threads may make use
of this functionality: the thread needs to be reloaded but its previous instance must
be killed. For this we need to persist the variable until after the reload and then
kill the thread

An example:

    (make-persistent-state-destructor 'name (lambda () (thread (lambda ()
                                              (let loop ()
                                                (sleep 1)
                                                (displayln (current-seconds))
                                                (loop)))))
                                      kill-thread)

On my webserver I have a thread that performs certain IO operations periodically, however,
I want it to be reloaded (and the old instance killed) whenever I change a file. This would
be a very good addition to the library.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant