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

remove createProxies #215

Closed
7 tasks done
katzIdo opened this issue Nov 13, 2019 · 0 comments
Closed
7 tasks done

remove createProxies #215

katzIdo opened this issue Nov 13, 2019 · 0 comments

Comments

@katzIdo
Copy link
Collaborator

katzIdo commented Nov 13, 2019

General description

remove createProxies from the API

createProxies has 2 benefits.

  1. it allows creating multi proxies in 1 function
  2. it has isAsync flag which resolves a proxy after it registered in the registry

both operations are not needed.

  1. the configuration is almost the same so it does not save code.
  2. async router solves the problem of requesting a service before it is available in the registry in a better way.

API

Design proposition

A clear and concise description of the design proposition.

  • Changes existing API

  • Removes existing API

Pull Request

[Link]

Old API

Code snippet

/**
 * @interface Microservice
 * Provides the functionality of a microservice container
 */
export interface Microservice {
  /**
   * @method destroy
   * The method is used to delete a microservice and close all the subscriptions related with it
   */
  destroy: () => Promise<any>;

  /**
   * @method createProxies
   * Create a map of proxies or Promises to proxy. (deepened on configuration)
   */
  createProxies: CreateProxies;

  /**
   * @method createProxy
   * Creates a proxy to a method and provides extra logic when is invoked
   */
  createProxy: CreateProxy;

  /**
   * @method createServiceCall
   * Exposes serviceCall to a user (not via Proxy)
   */
  createServiceCall: CreateServiceCall;
}

New API

Code snippet

/**
 * @interface Microservice
 * Provides the functionality of a microservice container
 */
export interface Microservice {
  /**
   * @method destroy
   * The method is used to delete a microservice and close all the subscriptions related with it
   */
  destroy: () => Promise<any>;

  /**
   * @method createProxy
   * Creates a proxy to a method and provides extra logic when is invoked
   */
  createProxy: CreateProxy;

  /**
   * @method createServiceCall
   * Exposes serviceCall to a user (not via Proxy)
   */
  createServiceCall: CreateServiceCall;
}

Behavior

Consideration

  1. remove/modify tests that use createProxies
  2. remove createProxies from documentation

Ready for implementation

  • API has been approved

  • Discussed with Technical lead

Definition of Done

  • Developer review

  • QA review

  • Documentation

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

No branches or pull requests

1 participant