-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chg: [serializer] add support for phoenix version 2 serialization #68
base: main
Are you sure you want to change the base?
Conversation
I added basic support for sending data. |
@gallypette Is broadcast functionality working right now? |
It is still a poc, but yes.
The library has to be converted to full async to be able to send/receive without getting stuck in the listen function. |
@gallypette i can't make it workable
|
I guess you don't match correctly on your topic name in your channel code. Something like this would do: def join(_topic, _payload, socket) do
{:ok, socket}
end
def handle_in("test event", payload, socket) do
{:reply, {:ok, payload}, socket}
end For listening for the answer is a bit tricky though (because of the while loop in
Get answer to your input:
|
I pushed an async version that is more suitable for send/receive patterns. |
@gallypette Can we use broadcast events using your asynchronous branch(flowintel:master) with realtime server in saas version of supabase? Or we need implement some handlers at Phoenix? |
@MindsightsAI I was not aware that supabase realtime had this feature. Going quickly through realtime-js source code for send and _push, it looks like sending a "broadcast" event should work out of the box using this branch. |
I reopen this PR as it seems relevant after all. |
* safe callback --------- Co-authored-by: seva <[email protected]>
I just found out about @maxbaluev and @karvetskiy 's fork and decided to merge their forks into this PR to keep track of their progress. |
@gallypette Hey. Thanks for noticing my PR. Want to notify you to be careful with sync callbacks because they are running blocking now. I think it is better to implement Thread execution logic if you want to use it |
Thanks for the work on this. Any news for the merge in the default branch? We recently saw https://github.com/bitnom/aiorealtime so maybe it's another option. |
A PR to be able to use this library with latest phoenix versions.
feature: support phoenix version 2 serialization (mostly turn {} in [])
bugfix: socket.summary was broken
default: set hearbeat to 30 seconds (javascript's version default)
I did not test whether I broke compatibility with version 1, so consider this as a request for comments.