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

feat/refactor: Collector/MessageCollector #65

Merged
merged 9 commits into from
Mar 8, 2020
Merged

feat/refactor: Collector/MessageCollector #65

merged 9 commits into from
Mar 8, 2020

Conversation

Khaaz
Copy link
Owner

@Khaaz Khaaz commented Mar 2, 2020

PULL REQUEST

Overview

This PR introduce a new way to use and interact with Collectors.
The philosophy behind this is to reduce the amount of event listeners at the same time.

This refactor MessageCollector, Collectors in general and any generics class from these to be used as one instance, using the same listeners until all collectors ends.
This will reduce the potentially exponential amount of listeners that would be added at the same time, to the basics one.
One instance can be kept along the framework and be reused dynamically and easily.

This however still allows to create as many instance of Collectors as needed.

Finally this PR brings multi-lib support to Collectors.

Status

  • Typings have been updated or don't need to be.
  • This PR have been tested and is ready to be merged.

Semantic versioning classification

  • This PR introduces BREAKING changes.
  • This PR adds new features, improve the code and implies minimal changes.
  • This PR fixes a bug and references the relevant issue or documentation.
  • This PR improve performance or code refactor without API changes.
  • This PR only includes non-code changes (documentation, CI, tools...).

@Khaaz Khaaz changed the title Refactor/feat: Collectors [WIP] refactor/feat: Collectors [WIP] Mar 2, 2020
@Khaaz Khaaz mentioned this pull request Mar 2, 2020
7 tasks
@Khaaz Khaaz changed the title refactor/feat: Collectors [WIP] feat: Collector Mar 7, 2020
@Khaaz Khaaz changed the title feat: Collector feat/refactor: Collector/MessageCollector Mar 7, 2020
@Khaaz Khaaz mentioned this pull request Mar 8, 2020
7 tasks
@Khaaz Khaaz merged commit 0026065 into dev Mar 8, 2020
@Khaaz Khaaz deleted the collectors branch March 8, 2020 13:08
@@ -0,0 +1,65 @@
/**
Copy link
Contributor

Choose a reason for hiding this comment

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

Just wondering, why's this not in src/External where all the other Queue classes are?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Well this one is a really specific structure. But I think you are right and I'll implement a generic sorted array for this. And then I'll use that here instead of timeout queue

Copy link
Owner Author

Choose a reason for hiding this comment

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

See #69

this._preRun(options, resolve, reject);
} );

return promise
Copy link
Contributor

Choose a reason for hiding this comment

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

Couldn't figure out the return type for this

Copy link
Owner Author

Choose a reason for hiding this comment

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

Promise<Map<K: String, V: T>>

Copy link
Owner Author

Choose a reason for hiding this comment

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

It resolves with all collected elements

@Khaaz
Copy link
Owner Author

Khaaz commented Mar 9, 2020

Fixed most of it except for TimeoutQueue in 420c313

bsian03 added a commit to bsian03/AxonCore that referenced this pull request Mar 9, 2020
@Khaaz Khaaz mentioned this pull request Mar 10, 2020
7 tasks
@Khaaz
Copy link
Owner Author

Khaaz commented Mar 11, 2020

See: 516c079
Collector.Run with no default implementation: fd31a57

Khaaz pushed a commit that referenced this pull request Mar 20, 2020
* Enum documentation fixes

* Lint types folder (soon)

* Split typings

* Codefactor

* Removed unnecessary overload. Try and link #58 to PR?

* Should fix CI

* Reflect correction in 27d7d9c

* Added library typings

* Add rest of typings

* Typo

* Finished rest of library typings, bug fixes etc

* Export file, bug fixes, typos etc

* Typings change

* Naming typos

* Attempt 2

* b85c399, 22610d8 and df13457 reflections

* b854f61 reflections

* b8f415f reflections

* 9139554 reflections

* 7631742 reflections

* b0563ac reflections

* 95c586c reflections and bug fixes from previous commit

* 6296f7c reflections

* 21b3014 reflections

* 21b3014 reflections

* 38d7b34 reflections

* Added WinstonLogger

* Lint

* Don't emit file outputs on tsc check

* Add updateDBVal type

* Changed name

* Add path references

* fix

* Fix the damn CI

* Correct path

* 37a4838 and previous reflections

* f0978c2 reflections

* #64 reflections

* Clear warnings from e69bf1c

* 3ff2100 reflections

* e5bcc33 reflections

* Confirmed typo

* #65 reflections

* Rename

* #67 reflections

* Remove unused imports

* Added Library selector postinstall script, needs testing

* Remove language check/selection

* Remove variable in global

* Constant

* Move to scripts folder

* Exit process if CI detected

* Add CI env vars

* #69 reflections

* Added name to dep install and test

* Consistency

* #72 reflections

* Add first and sweep methods

* Test something

* Fix pathing

* Trying something...

* module declaration?

* Fix typings

* Return `this` where appropriate

* Save json only if invalid config

* Bump events to 13.9.2

* #70 reflections

* #66 reflections

* 0af8a88 reflections

* #73 reflections

* 061de33 reflections
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