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

Improve context getting #6

Open
mwvaughn opened this issue Sep 9, 2020 · 1 comment
Open

Improve context getting #6

mwvaughn opened this issue Sep 9, 2020 · 1 comment

Comments

@mwvaughn
Copy link
Contributor

mwvaughn commented Sep 9, 2020

Almost all SD2E actors have the following boilerplate code in their reactor.py

    mes = AttrDict(rx.context.message_dict)
    if mes == {}:
        try:
            jsonmsg = json.loads(rx.context.raw_message)
            mes = jsonmsg
        except Exception:
            pass

The rationale for this is that agavepy.actors#get_context fails to deserialize some JSON messages due to valid characters in the message that cannot be parsed by ast.literal_eval(text) (see https://github.com/TACC/agavepy/blob/master/agavepy/actors.py#L65)

@mwvaughn
Copy link
Contributor Author

mwvaughn commented Sep 9, 2020

After conferring with @joestubbs we will improve agavepy.actors#get_context rather than bolting this behavior on to the SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant