• Przemyslaw Kaminski's avatar
    [websockets] initial implementation of async notifications · 9de83328
    Przemyslaw Kaminski authored
    I'm currently able to do the following:
    - start gargantext-server (as it hosts central exchange and
    dispatcher, currently)
    - start a websocket connection:
      websocat ws://localhost:8008/ws
    - subscibe to a topic (in websocat):
      {"request": "subscribe", "topic": {"type": "update_tree", "node_id":
      15}}
    - optionally subscibe to other node_ids or start other websocat's with
      different subscriptions (can be multiple)
    - fire up
      cabal v2-run gargantext-central-exchange -- client
      This triggers a node_id: 15 and node_id: 16 notification to be sent
    
    You can send your own notifications, e.g. with Python:
    import json
    import nanomsg as n
    s = n.Socket(n.PUSH)
    s.connect('tcp://localhost:5560')
    s.send(json.dumps({'type': 'update_tree_first_level', 'node_id': 15}))
    9de83328
Name
Last commit
Last update
..
Admin Loading commit data...
Auth Loading commit data...
Errors Loading commit data...
GraphQL Loading commit data...
Ngrams Loading commit data...
Node Loading commit data...
Context.hs Loading commit data...
Count.hs Loading commit data...
Dev.hs Loading commit data...
EKG.hs Loading commit data...
Errors.hs Loading commit data...
Flow.hs Loading commit data...
GraphQL.hs Loading commit data...
HashedResponse.hs Loading commit data...
Job.hs Loading commit data...
Members.hs Loading commit data...
Metrics.hs Loading commit data...
Middleware.hs Loading commit data...
Ngrams.hs Loading commit data...
Node.hs Loading commit data...
Prelude.hs Loading commit data...
Public.hs Loading commit data...
Routes.hs Loading commit data...
Search.hs Loading commit data...
Server.hs Loading commit data...
Swagger.hs Loading commit data...
Table.hs Loading commit data...
ThrowAll.hs Loading commit data...
Types.hs Loading commit data...
WebSockets.hs Loading commit data...