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

Dead letters equivalent? #37

Open
drozzy opened this issue Jul 16, 2014 · 1 comment
Open

Dead letters equivalent? #37

drozzy opened this issue Jul 16, 2014 · 1 comment

Comments

@drozzy
Copy link

drozzy commented Jul 16, 2014

Is there an equivalent of dead letters in pykka?
I.e. ability to see all the message (at least in a log) that were not delivered anywhere?

Currently, I implement this as follows in my actor:

if message.get('command') == 'poll':
        # logic
else:
        logging.log(logging.DEBUG, 'Dead letters: ' + str(message))
@jodal jodal added the wishlist label Aug 10, 2014
@jodal jodal added the docs label Jan 29, 2019
@jodal
Copy link
Owner

jodal commented Jan 29, 2019

The default implementation of on_receive() in the Actor class will log any unexpected messages on the WARNING log level. If using that, your example could then be updated to:

def on_receive(self, message):
    if message.get('command') == 'poll':
        ... # logic
    else:
        super().on_receive(message)

I'll see if we can improve the docs to include a section on unexpected messages.

@drozzy drozzy closed this as completed Jan 31, 2019
@jodal jodal reopened this Jan 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants