-
Notifications
You must be signed in to change notification settings - Fork 14
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
Docs for ActivityWorker #25
Comments
+1. Specifically, the coordinated handlers could use some documentation. Not really clear what start, tick, and cancel functions should be responsible for and what state they should maintain (if any.) |
not really docs, but the tests have 3 examples of coordinated handlers here https://github.com/sclasen/swfsm/blob/master/activity/coordinated_worker_test.go#L177-L254 the tick counting example maintains state, which is used in the test here https://github.com/sclasen/swfsm/blob/master/activity/coordinated_worker_test.go#L172 |
Yeah, I had looked through those. Tick is the main point of confusion. Seems to be called every heartbeat? Is it supposed to do work? (In one test the tick function was called "Work"). Start = used to start work. Cancel = used to cancel work. Tick= ? |
@ryanwalls yeah, so lets take the example of running some sort of long running job. Start would start the job running. Tick would monitor the job, perhaps returning updates if desired. It does have a return type that is a bit strange.
If the heartbeating goroutine recieves |
Of course you could do slightly different things with Start and Tick too. Start could verify that you could connect to a queue or some such, and Tick could poll the queue and consume it. |
@sclasen Awesome. That was exactly what I needed. Makes sense. |
…andler Docs were taken from Scott’s reply here: sclasen#25 (comment)
@sclasen I'm 99% sure that true/false should be switched in your comment above. #25 (comment) When tick returns
Updating my PR in just a minute to reflect the corrected description. |
once #24 is in
The text was updated successfully, but these errors were encountered: