Re: Hitting an API with Euphoria

new topic     » goto parent     » topic index » view thread      » older message » newer message
euphoric said...

Node.js has async functionality, so it's nice to use it to hit an API websocket and grab data while other processes continue.

Cool.

Euphoria has HTTP support, but not WebSockets. Doesn't look too hard to add, though: https://en.wikipedia.org/wiki/WebSocket

euphoric said...

I'm curious, could Euphoria be used to pull data from a web socket, keeping maybe a sequence populated with the latest data, while another part of the code utilizes that data?

Yes, the easiest way will be to use tasks.

euphoric said...

Node.js has async/await, but is that really necessary for what I want to do?

If you need to do other things while waiting on the data, then you will need nonblocking/async sockets. It's not necessary if you are ok with blocking waits (but few are). Even with tasks, a blocking call will cause all tasks to wait.

True multithreading would resolve this, but that's still experimental for Eu.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu