Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Enhancement Request: Allow the component to apply custom policy of handling the watch-state of when the switchboard restart #51

Open
zhanghuabin opened this issue Oct 11, 2018 · 2 comments

Comments

@zhanghuabin
Copy link

zhanghuabin commented Oct 11, 2018

Hi, Matthias:

I used system-toolbox-* in our online service in past 2 years, thanks for your hard work, your libs are excellent.
But recently I met a little trouble of system-toolbox, please see the background of problem as below:

  1. I have a component, which will create some external resources in state-fn.
  2. this component has a shutdown-fn as well for closing those external resources when restart the switchboard.
  3. and then new external resources will be created in init phase.
  4. what I expected is: when the handler of new component receives an event, I can get new resources from current-state.
  5. but the actual result is: I get old closed resources now.
  6. I have to make a workaround: use @(:cmp-state state) to get the new real current-state of new component
  7. these are the timelines when I reproduce this issue.
    init
    b-cmp

Do you have any suggestion better than my workaround in this scene?
Or you may design a mechanism/option to allow the component to controll if they want to reserve the old state or not.

Please keep alive meo and system-toolbox-*, I believe they have many fans. :-)

Thanks a lot
Huabin Zhang

@matthiasn
Copy link
Owner

matthiasn commented Oct 11, 2018 via email

@zhanghuabin
Copy link
Author

zhanghuabin commented Oct 16, 2018

Sorry for reply so late, I'm on vacation, ;-)

I apply the Clojure/Script and system-toolkit-* in our two groups of services:

  1. A deCAPTCHA service cluster, I define different algorithm as async component, and an individual component for message routing, the cluster is for load-balancing.
  2. A whole web app of our internal OA system. For frontend, I refer to your meo project(websocket, reactjs, spa, etc). I use shadow-cljs for building, you may have a try, which is cool.

I knew that :reload option and I have tried, it worked but if we say we must close some resources during the restarting flow, that means we have to realize shutdown fn and enable :reload, that will cause the above problem.

Thanks
Huabin

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

No branches or pull requests

2 participants