3 what s the best way to implement `push
3. what's the best way to implement
push notification
? is it something like this ? and is it run as an OS thread or a greenlet in eventloop ?
```
@solara.component
def Page():
push_notifications = solara.use_reactive([])
def worker():
// infinite loop
while True:
// wait for some condition
// push_notifications.set(...)
solara.use_thread(worker)mariobuikhuizen•285d ago
Yes, this is the best way to do it if
//wait for some condition
is not based on Solara reactive vars or component args and you have to wait on the next condition again. Note that the worker function needs an argument: cancel: threading.Event
MaartenBreddels•285d ago
That’s optional btw
446Members
View on DiscordWant results from more Discord servers?
More Posts2 when I create a module level reactive2. when I create a module level reactive var like `x = solara.reactive(None)`, is it application widcouple of questions around sessioncouple of questions around session management:
1. I found Solara manages session via cookie which isI m not sure what you mean but changingI'm not exactly sure what you mean, but changing the value from the backend would look something likhey solara team looking into statehey solara team looking into state documentation. It seems solara.reactive is session based as in ifhope to know when we will get this fixedhope to know when we will get this fixed. I am developing some demo with Solara and don't want to seThe timer thread is an infinte loop ThatThe timer thread is an infinte loop. That's the only loop I know of. And the timer isn't a problem