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

Feature: DynamicModule + KV Queue Module #80

Merged
merged 5 commits into from
Feb 28, 2024
Merged

Conversation

Sorikairox
Copy link
Collaborator

Description

KV Queue module allows users to integrate Deno.kv queue system into their Deno application.


Issue Ticket Number

Fixes #75


Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)
  • This change requires a documentation update

Checklist:

  • I have run deno lint AND deno fmt AND deno task test and got no
    errors.
  • I have followed the contributing guidelines of this project as mentioned
    in CONTRIBUTING.md
  • I have checked to ensure there aren't other open
    Pull Requests for the same
    update/change?
  • I have performed a self-review of my own code
  • I have made corresponding changes needed to the documentation

@Sorikairox Sorikairox self-assigned this Feb 20, 2024
@Sorikairox
Copy link
Collaborator Author

@marco-souza I would like your thoughts on this implementation !

More specifically on the forRoot which returns an instance of the module. It works and allows us to pass a name for the kv connection, but we can also do something like this instead.

@Module({
		imports: [new KvQueueModule('myConnectioName')],
		controllers: [TestController],
		injectables: [TestListener],
	})

I am kinda not comfortable with it, but that's what the forRoot actually does.

@marco-souza
Copy link
Contributor

@Sorikairox I personally like the idea of instantiating the KvQueueModule passing the configurations as constructor params. For me, this looks more straightforward than having a static method only for building it.

On the other hand, not having forRoot breaks the expected interface for users with a Nestjs background. This could make Danet less compatible with Nestjs if this is something we need to worry about.

Copy link
Contributor

@marco-souza marco-souza left a comment

Choose a reason for hiding this comment

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

Thanks, the code looks good! 👍🏼

Also, It would be nice to have an example/queue.ts for documentation.

src/kv-queue/module.ts Outdated Show resolved Hide resolved
src/kv-queue/module.ts Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Feb 24, 2024

Codecov Report

Attention: Patch coverage is 97.67442% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 88.39%. Comparing base (c10ab66) to head (e273a60).

❗ Current head e273a60 differs from pull request most recent head b65f947. Consider uploading reports for the commit b65f947 to get more accurate results

Files Patch % Lines
src/kv-queue/kv.ts 90.62% 3 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #80      +/-   ##
==========================================
+ Coverage   87.56%   88.39%   +0.83%     
==========================================
  Files          58       63       +5     
  Lines        1801     1904     +103     
  Branches      183      196      +13     
==========================================
+ Hits         1577     1683     +106     
+ Misses        221      218       -3     
  Partials        3        3              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Sorikairox Sorikairox changed the title Feature: KV Queue Module Feature: DynamicModule + KV Queue Module Feb 25, 2024
src/kv-queue/module.ts Show resolved Hide resolved
@Sorikairox Sorikairox merged commit 887c762 into main Feb 28, 2024
1 check passed
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.

Suggestion: Events for Danet
3 participants