Search code examples
websocketerlangmnesiayaws

How i can send data from mnesia via websocket


I have mnesia DB with table artists:

(gw@gw)227> lookup:for_test().
{atomic,["Baltic Baroque","Anna Luca","Karel Boehlee Trio",
     "Bill Evans","Dino Saluzzi and  Anja Lechner",
     "Bill Evans Trio with Stan Getz","Duke Pearson",
     "The John Butler Trio"]}
(gw@gw)228>

I want send this list to client by websocket in YAWS, but how i can do it? I broke my mind ... and nothing working. Please help by any info.

Best regards!


Solution

  • You have to convert this list of string to binaries and the pass is across over web socket, by the way what kind of data handling are you doing at the receiving end I mean you want to send this as JSON or just Comma separated values?