From 6703ce472665f58f3ea2bd9af23feb6963f19912 Mon Sep 17 00:00:00 2001 From: Roman Heinrich Date: Fri, 10 Nov 2023 20:49:53 +0100 Subject: [PATCH] Chore: update code generators to latests changes --- gen/src/ApiGenerator.ts | 10 +++++++++- gen/src/MainGenerator.ts | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/gen/src/ApiGenerator.ts b/gen/src/ApiGenerator.ts index 5f7ef00..d0e6abd 100644 --- a/gen/src/ApiGenerator.ts +++ b/gen/src/ApiGenerator.ts @@ -68,10 +68,18 @@ export class ApiGenerator extends GenBase { alias Surrealix.Config alias Surrealix.Socket + alias Surrealix.SocketState alias Surrealix.Util defp exec_method(pid, {method, args, task}, opts \\\\ []) do - Socket.exec_method(pid, {method, args, task}, opts) + Socket.exec_method(pid, {method, args, task}, opts) + end + + @doc """ + Show all currently registered live queries (SQL) + """ + def all_live_queries(pid) do + :sys.get_state(pid) |> SocketState.all_lq() end @doc """ diff --git a/gen/src/MainGenerator.ts b/gen/src/MainGenerator.ts index fa592de..6158444 100644 --- a/gen/src/MainGenerator.ts +++ b/gen/src/MainGenerator.ts @@ -34,6 +34,11 @@ export class MainGenerator extends GenBase { defdelegate start_link(opts \\\\ []), to: Socket defdelegate stop(pid), to: Socket + @doc """ + Show all currently registered live queries (SQL) + """ + defdelegate all_live_queries(pid), to: Api + @doc """ Convenience method, that combines sending an query (live_query) and registering a callback