Skip to content
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

Pass the cp Handler to an after decorator #344

Open
betovaca opened this issue Jul 1, 2022 · 0 comments
Open

Pass the cp Handler to an after decorator #344

betovaca opened this issue Jul 1, 2022 · 0 comments
Labels
question Further information is requested

Comments

@betovaca
Copy link

betovaca commented Jul 1, 2022

Hello,

Just like when I send a message from my cp to my server:

async def send_heartbeat(self, cp, interval=3600):
    request = call.HeartbeatPayload()
    while True:
        await cp.call(request)
        await asyncio.sleep(interval)

I send the cp handler to send the message.
I would like to do the same thing for an after decorator so it can send messages from the cp handler. Right now I have this:

@after(Action.GetBaseReport)
async def after_get_base_report_request(self, request_id, report_base):
    await send_notify_report_request(report_base=report_base, request_id=request_id)

But my send_notify_report_request is defined as follows : async def send_notify_report_request(self, cp, **kwargs)

How could I manage to send my cp handler for an after decorator?

@betovaca betovaca added the question Further information is requested label Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

No branches or pull requests

1 participant