Skip to content

Update state from external action #613

Answered by tmarrinan
tmarrinan asked this question in General
Discussion options

You must be logged in to vote

I now have something that works... it relies on a separate queue system rather than working with the state directly, so not sure if this is a real solution or more of a workaround, but it achieves what I need. Posting in case others run into similar situation:

import asyncio
from multiprocessing import Process, Queue
from multiprocessing.managers import BaseManager
from trame.app import get_server, asynchronous
from trame.widgets import vuetify
from trame.ui.vuetify import SinglePageLayout

class QueueManager(BaseManager):
    pass

def main():
    # create queue for Trame state
    state_queue = Queue()
    
    # start Trame app as new process
    trame_proc = Process(target=runTrameSer…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by tmarrinan
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants