Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lnbits/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ def template_renderer(additional_folders: Optional[List] = None) -> Jinja2Templa

def get_current_extension_name() -> str:
"""
DEPRECATED: Use the repo name instead, will be removed in the future
before: `register_invoice_listener(invoice_queue, get_current_extension_name())`
after: `register_invoice_listener(invoice_queue, "my-extension")`

Returns the name of the extension that calls this method.
"""
import inspect
Expand Down
2 changes: 2 additions & 0 deletions lnbits/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ def pop(self, key, v=_RaiseKeyError) -> None:
invoice_listeners: Dict[str, asyncio.Queue] = SseListenersDict("invoice_listeners")


# TODO: name should not be optional
# some extensions still dont use a name, but they should
def register_invoice_listener(send_chan: asyncio.Queue, name: Optional[str] = None):
"""
A method intended for extensions (and core/tasks.py) to call when they want to be
Expand Down