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