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

KOJO-217 | Start of Usage Patterns guide #118

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mucha55
Copy link
Contributor

@mucha55 mucha55 commented Feb 25, 2021

I went back on forth on how best to present this stuff, let me know which parts you like and what you dislike, and I'll do it for other example patterns

@mucha55 mucha55 self-assigned this Feb 25, 2021
--- | --- | ---
can_work_in_parallel | |
cron_expression | |
schedule_limit | |
Copy link
Contributor

Choose a reason for hiding this comment

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

I like the idea of expressing this as a quick reference table. If we transpose the rows we can add all the patterns so they can be viewed side-by-side to compare them easier:

pattern can_work_in_parallel cron_expression schedule_limit
static schedule false 0 0 * * * 1
continuous singleton false * * * * * 1
delagated linear clone true * * * * * 10
dynamically scheduled true null null


### Continuous Singleton

This pattern is for situations where you need to do some work continuously, and having a single process is sufficient compute for keeping up with the work (e.g. polling something for changes and then processing those changes).
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be useful to include a visual diagram of each pattern something like

Class Diagram

Made this with https://plantuml.com/activity-diagram-beta and put linked it as an image via https://github.com/Zingam/UML-in-Markdown


#### Kojo Runtime API Interactions

None.
Copy link
Contributor

Choose a reason for hiding this comment

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

What would go in here normally?

  • happy path: ->requestCompleteSuccess()->applyRequest()
  • error path: ->requestCompleteFailed()->applyRequest()
  • DLC Patten ->schduleNewJob($job)?

@alexberryman alexberryman self-requested a review March 2, 2021 00:28
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 this pull request may close these issues.

2 participants