mayulu
Hi,
The question I tried a lot and have got no idea.
After
{:ok, conn} = Redix.start_link(host: "127.0.0.1", port: 6379)
conn is PID like pid<0.554.0>
Then I send some special command to redis server:
{:ok, OK} = Redix.start_link(conn, [...some special command...])
The special redis server may then further push a series responses to conn separately and constantly.
I want to use :
:gen_tcp.recv(socket, 0)
to receive data from redis server in process pid<0.554.0>
But conn is a PID (etc. TCP Client) not a socket, So how can I get socket from the PID.
Anyone can give me a glue?
Thanks
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #security










Showing Posts 1 to 2- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
idi527
Maybe there is a way to do it via redix? Either way, redix probably keeps the socket in it’s state, you can try a hack like
:sys.get_state(redix_conn)to find out.Seems like it is started with:gen_tcp.recv(socket, 0)might not work if the socket is started inactive: truemode.active: :once. And is reset to that mode after each received packet. So you might try something likeBut a more correct approach is most likely possible, since you might receive the data you don’t need, which would in turn make other queued requests fail.
I’d probably fork redix and add a way to subscribe for updates, especially if it’s some special redis server.
mayulu
I got the socket after following your instruction.
returned the following:
socket is a Port<0.9>
Then after
It get a error, the socket did not work
But you figured me out, it is not the right way. It should be done in the redis lib.
I should fork Redix or find other redis lib.
(similar to redigo lib in golang, there is a Receive function in such situation.)
Thank you very much.