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

How to access catbox client instances through the framework? #4041

Closed
osukaa opened this issue Feb 6, 2020 · 2 comments
Closed

How to access catbox client instances through the framework? #4041

osukaa opened this issue Feb 6, 2020 · 2 comments
Assignees
Labels
dependency Update module dependency feature New functionality or improvement
Milestone

Comments

@osukaa
Copy link

osukaa commented Feb 6, 2020

Support plan

  • which support plan is this issue covered by? (e.g. Community, Core, Plus, or Enterprise): Community
  • is this issue currently blocking your project? (yes/no): no
  • is this issue affecting a production system? (yes/no): no

Context

  • node version: LTS 12
  • module version: hapi@19
  • environment (e.g. node, browser, native): node
  • used with (e.g. hapi application, another framework, standalone, ...): hapi application and catbox
  • any other relevant information:

How can we help?

My current setup includes creating a custom catbox Redis client, which also provides metrics as part of its public API.

I would like to know if there's a way to have access to the instance so that I can pull the metrics out.

Or if not possible, is there a way to plug the metrics into the framework itself? through the events or similar?

 const server = hapi.server({
    cache: [
      {
        provider: {
          constructor: require('custom-catbox-redis'),
          options: redisOptions,
        }
      }
    ],
  });

// how could I get the instance back?
@osukaa osukaa added the support Questions, discussions, and general support label Feb 6, 2020
@osukaa
Copy link
Author

osukaa commented Feb 10, 2020

I went through the code and found about _core.caches, but I don't feel that it is correct to access the underscore property.

@hueniverse hueniverse self-assigned this Mar 14, 2020
@hueniverse hueniverse added this to the 19.1.2 milestone Mar 14, 2020
@hueniverse hueniverse added dependency Update module dependency feature New functionality or improvement and removed support Questions, discussions, and general support labels Mar 14, 2020
@hueniverse
Copy link
Contributor

When you provision a server.cache() you can now get cache.client with access to the cache implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency Update module dependency feature New functionality or improvement
Projects
None yet
Development

No branches or pull requests

2 participants