https://htmx.org logo
Join Discord
Powered by
# htmx-general
  • g

    gorgeous-ghost-95789

    11/25/2020, 6:02 PM
    It should already work like that right now.
  • m

    mysterious-toddler-20573

    11/25/2020, 6:02 PM
    should update the docs
  • m

    mysterious-toddler-20573

    11/25/2020, 6:02 PM
    to clarify one connect
  • m

    mysterious-toddler-20573

    11/25/2020, 6:03 PM
    but you can have a child listen for events on multiple sources, if they are on elements above the child in the dom
  • f

    future-boots-43048

    11/25/2020, 6:03 PM
    That's interesting ...
  • f

    future-boots-43048

    11/25/2020, 6:03 PM
    My system is really braindead right now -- I have a different SSE endpoint for each resource on the server that can be updated.
  • f

    future-boots-43048

    11/25/2020, 6:05 PM
    So lots and lots of connections, potentially.
  • f

    future-boots-43048

    11/25/2020, 6:05 PM
    I don't know if that's a bad thing. (It might be).
  • g

    gorgeous-ghost-95789

    11/25/2020, 6:05 PM
    First thought: it might be a bad thing.
  • g

    gorgeous-ghost-95789

    11/25/2020, 6:06 PM
    But, you could do it. Each "connect" would just need to be on its own DOM node.
  • f

    future-boots-43048

    11/25/2020, 6:07 PM
    It might be better to modify my server so the SSE endpoint represents a 'query' with a list of resources to monitor for changes...
  • g

    gorgeous-ghost-95789

    11/25/2020, 6:07 PM
    Probably better to have a smaller number of connections, then filter things out via EventName, if that's possible with Firebase.
  • f

    future-boots-43048

    11/25/2020, 6:08 PM
    I've just got my own uvicorn/starlette python server.
  • f

    future-boots-43048

    11/25/2020, 6:08 PM
    So my own logic on back and front end.
  • g

    gorgeous-ghost-95789

    11/25/2020, 6:08 PM
    Yes. That's what I'm doing as well. Each page has (essentially) one SSE connection and UUID. Anything that changes on the server gets linked to the appropriate UUIDs. Lots of things can change on each page, but they're all segmented via EventNames (which are also a UUID)
  • f

    future-boots-43048

    11/25/2020, 6:08 PM
    Mostly I generate the HTML on the backend from Python components.
  • f

    future-boots-43048

    11/25/2020, 6:09 PM
    Yeah.
  • g

    gorgeous-ghost-95789

    11/25/2020, 6:09 PM
    Oops, sorry @User -- I switched you in my head with someone else.
  • f

    future-boots-43048

    11/25/2020, 6:09 PM
    I'm thinking of making the SSE connection just be the concatenation of all the UUIDs that it issues updates for.
  • g

    gorgeous-ghost-95789

    11/25/2020, 6:10 PM
    I'd be happy to share code with you, but it's in Go, and I'm not sure it would translate well.
  • g

    gorgeous-ghost-95789

    11/25/2020, 6:10 PM
    Yes. I think that's the best way.
  • g

    gorgeous-ghost-95789

    11/25/2020, 6:10 PM
    In the real-time server I'm building, different content objects are all linked together. So, if one updates, I know to notify anyone subscribed to it, or its parents or grandparents.
  • g

    gorgeous-ghost-95789

    11/25/2020, 6:11 PM
    That calculation should be easy enough to do on the server.
  • f

    future-boots-43048

    11/25/2020, 6:12 PM
    Makes sense.
  • f

    future-boots-43048

    11/25/2020, 6:12 PM
    I've got a distributed data-flow thing going on in the back end.
  • f

    future-boots-43048

    11/25/2020, 6:12 PM
    Because it's designed to pull information and UI fragments from a fleet of autonomous vehicles.
  • g

    gorgeous-ghost-95789

    11/25/2020, 6:13 PM
    Oh wow. That's a way cooler use-case than my chat app.
  • g

    gorgeous-ghost-95789

    11/25/2020, 6:13 PM
    Super jealous!
  • g

    gorgeous-ghost-95789

    11/25/2020, 6:13 PM
    Does all of the data flow in to a single place, though? I'd still expect a single cluster/db of machines collects the updates before it is sent back out to your browser clients.
  • f

    future-boots-43048

    11/25/2020, 6:14 PM
    Not really.
1...767778...1146Latest