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

cylc message payload #2502

Closed
hjoliver opened this issue Dec 5, 2017 · 4 comments · Fixed by #2582
Closed

cylc message payload #2502

hjoliver opened this issue Dec 5, 2017 · 4 comments · Fixed by #2582
Assignees
Milestone

Comments

@hjoliver
Copy link
Member

hjoliver commented Dec 5, 2017

Messages from task jobs are currently just single strings. Ideally users could send an arbitrary serializable payload (probably a dict) to be passed on to event handlers. This could be particularly useful when suites or suite components may be reused in different contexts, so that the suite or event handler does not have to know additional context-specific information about the event represented by a message.

@hjoliver hjoliver added this to the some-day milestone Dec 5, 2017
@matthewrmshin
Copy link
Contributor

Sounds like we have a revival of #181. I think the solution proposed by #2214 (comment) should help to solve this.

@matthewrmshin
Copy link
Contributor

Just to elaborate, I think the proposed CLI wrapper for the network API can be used for just this - as I expect the command to have a simple interface such as:

cylc client my-suite put_message <<<'__JSON__'
{"task_id": "mytask.1", "severity": "CUSTOM", "message": "a\ngigantic\nmessage\ntower"}
__JSON__

@hjoliver
Copy link
Member Author

hjoliver commented Dec 5, 2017

#181 was about providing additional information held by the suite server program to event handlers (and now we have quite an extensive list of possible event handler args of that kind).

This is about allowing task jobs to send arbitrary data back to the suite server program, not just a text string. (However, your second comment, which was posted as I wrote this, shows you know that).

@matthewrmshin
Copy link
Contributor

matthewrmshin commented Dec 5, 2017

Obviously, we can also modify cylc message to be able to read from STDIN.

As an aside, it may be time that we rationalise the CLI of cylc message to be a bit more like the other client commands. Suggest cylc message [OPTIONS] SUITE TASK-ID MESSAGE. If MESSAGE is -, read message from STDIN.

(Or maybe even cylc message [OPTIONS] SUITE MESSAGE TASK-ID [...] for the future where we may have multiple tasks run by a single batch job.)

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

Successfully merging a pull request may close this issue.

2 participants