Skip to content

Commit

Permalink
Merge pull request #17 from fabawi/dev
Browse files Browse the repository at this point in the history
Fixed repeated publishing
  • Loading branch information
fabawi committed Aug 22, 2022
2 parents 531c972 + 1f2133a commit eaa1afe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wrapify/connect/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def encapsulate(func):
def wrapper(*wds, **kwds): # Triggers on calling the function
# execute the function as usual
if cls._MiddlewareCommunicator__registry[func.__qualname__]["mode"] is None:
return func(*wds, **kwds)
return func.__wrapped__(*wds, **kwds)

instance_address = hex(id(wds[0]))
instance_id = cls._MiddlewareCommunicator__registry[func.__qualname__]["__WRAPIFY_INSTANCES"].index(instance_address) + 1
Expand Down Expand Up @@ -90,7 +90,7 @@ def wrapper(*wds, **kwds): # Triggers on calling the function
new_args, new_kwargs = match_args(
communicator["return_func_args"][comm_idx], communicator["return_func_kwargs"][comm_idx], wds[1:], kwd)
communicator["wrapped_executor"].append(pub.Publishers.registry[communicator["return_func_type"][comm_idx]](*new_args, **new_kwargs))
returns = func(*wds, **kwds)
returns = func.__wrapped__(*wds, **kwds)
for ret_idx, ret in enumerate(returns):
wrp_exec = cls._MiddlewareCommunicator__registry[func.__qualname__ + instance_id]["communicator"][ret_idx]["wrapped_executor"]
# single element
Expand Down

0 comments on commit eaa1afe

Please sign in to comment.