Skip to content

Conversation

@ybastide
Copy link
Contributor

Issue #216

Signed-off-by: Yves Bastide <yves@botify.com>
-D, -W.

Signed-off-by: Yves Bastide <yves@botify.com>
* marker.Marker(name, details)

* task.MarkerTask(name, details)

* workflow.record_marker(name, details=None)
    -> return self.executor.record_marker(name, details)

* workflow.list_markers()
    -> return self.executor.list_markers()

* abstract methods in the base executor

Signed-off-by: Yves Bastide <yves@botify.com>
Also add an example.

Signed-off-by: Yves Bastide <yves@botify.com>
Signed-off-by: Yves Bastide <yves@botify.com>
@ybastide ybastide self-assigned this Feb 23, 2017
@ybastide
Copy link
Contributor Author

(missing tests...)

Add an option to show all the values of the markers, not just the last
one.

Signed-off-by: Yves Bastide <yves@botify.com>
@ybastide
Copy link
Contributor Author

^ damn, started to add tests but forgot to implement them...

Signed-off-by: Yves Bastide <yves@botify.com>
This simplifies the simpleflow.swf.executor.Executor#submit casts.

Signed-off-by: Yves Bastide <yves@botify.com>
def wait_signal(self, name):
return self.executor.wait_signal(name)

def record_marker(self, name, details=None):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not a serializable object for details ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this should be better.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, would be nice :)

Don't expect a string for `record_marker`'s `details` argument; instead,
serialize it and unserialize in `list_markers`.

* json_dumps/json.loads

* add serializers to _serialize_complex_object:
    * datetime.date
    * datetime.time
    * uuid.UUID

* update test

Signed-off-by: Yves Bastide <yves@botify.com>
The "+00:00" TZ was expected by some tests; we now replace it with "Z".
Oops.

Signed-off-by: Yves Bastide <yves@botify.com>
self.details = details

def __repr__(self):
return '<{klass} {name!r} details={details!r}>'.format(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't know the conversion flags, nice! :)

))
self.after_replay()
self.decref_workflow()
if self._append_timer and not self._timer_scheduled:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self._timer_scheduled seems to not be used anymore in current code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally unused, it's for some future timer PR 🙂
I'll add an explanation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... No, better remove it

def wait_signal(self, name):
return self.executor.wait_signal(name)

def record_marker(self, name, details=None):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, would be nice :)

Signed-off-by: Yves Bastide <yves@botify.com>
Signed-off-by: Yves Bastide <yves@botify.com>
Based on a comment by @ampelmann.

Signed-off-by: Yves Bastide <yves@botify.com>
Signed-off-by: Yves Bastide <yves@botify.com>
Try to load a string; if this fails, return the string itself.

Useful when the callee doesn't return a JSON-formatted result...

Signed-off-by: Yves Bastide <yves@botify.com>
Signed-off-by: Yves Bastide <yves@botify.com>
Signed-off-by: Yves Bastide <yves@botify.com>
@jbbarth
Copy link
Collaborator

jbbarth commented Mar 2, 2017

👍 ; needs more work before merging @ybastide ?

@ybastide
Copy link
Contributor Author

ybastide commented Mar 2, 2017

Nope (well, we'll have to discuss #222 later): let's merge and release!

@ybastide ybastide merged commit ec0fe2e into master Mar 2, 2017
@ybastide ybastide deleted the enhancement/216/Implement-markers branch March 2, 2017 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants