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

Convert Dragon processing from procedural to event-based #1

Closed
11 tasks done
bobbermac opened this issue Sep 23, 2017 · 7 comments
Closed
11 tasks done

Convert Dragon processing from procedural to event-based #1

bobbermac opened this issue Sep 23, 2017 · 7 comments
Assignees
Milestone

Comments

@bobbermac
Copy link

bobbermac commented Sep 23, 2017

In order to best support a flexible, extensible text processing framework, Dragon should support a user's or other application's ability to respond to published Dragon events. Event processing should also be a first-class citizen, with Dragon using it natively for all of its own internal processing.

Tasks:

  • Examine the existing general workflow for processing posts in Dragon
  • Identify all the stages at which points event publication might be useful. E.g., read file, write file; before-read, after-read, before-write, after-write
  • Convert Dragon parsing process to async
    • use a core.async pub-sub
    • devise a message structure that Dragon can use externally but which could be used by other apps (that use Dragon) too
    • keep in mind that plugins would likely use this as well
  • Identify all areas of Dragon that can and should be converted to using this new infrastructure
  • Create and add an event-system component
  • Publish an event when the event-system is up
  • Declare the full set of events and functions to run
  • Set up a subscriber registry in the event system component
    • create a simple, first draft for mass-subscription
@bobbermac
Copy link
Author

bobbermac commented Sep 24, 2017

Current data flow for parsing goes like this:

  1. Blog app: get configuration
  2. dragon.blog: walk the file system starting at the posts directory and process all legal post content
  3. dragon.blog.post: for each file, gather post stats, add dates, and convert post body based on content type
  4. Blog app: generate routes for each post & generate other routes that need post data (e.g., sitemap files)
  5. dragon.generator: using a map whose keys are routes and whose values are generator functions, write to the file system

@bobbermac bobbermac changed the title Add support for plugins Convert Dragon processing from procedural to event-based Sep 24, 2017
@bobbermac
Copy link
Author

bobbermac commented Sep 24, 2017

Proposed events (note that some may have a pre- and post- events:

  • read configuration - message should have configuration data
  • process all blog posts - message should have source dir location (post message should have all posts data)
  • read source file - pre message should have source file location and parsed file extension; post message should have same data as pre as well as read content and content type info
  • parse post content - pre message should have same message data as read-source-post message; post message should have parsed data
  • write output file - pre message should have all posts data; post message should have file write success/failure
  • generate routes - pre message should have all posts data; post message should have all routes and success/failure messages for each route's file write

@bobbermac
Copy link
Author

Looking awesome, @oubiwann! Thanks for doing this 😄

@oubiwann
Copy link
Member

oubiwann commented Oct 1, 2017

Moved registry tasks into their own ticket: #6

@oubiwann
Copy link
Member

oubiwann commented Oct 1, 2017

Moved switch to component-based approach to own ticket: #7

@oubiwann
Copy link
Member

oubiwann commented Oct 1, 2017

See PR #9

@oubiwann
Copy link
Member

oubiwann commented Oct 1, 2017

Merged.

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

No branches or pull requests

2 participants