Skip to content

Conversation

@chylli-deriv
Copy link
Contributor

No description provided.

return send_is_called
return response

def _call_middleware(self, name: str, args: dict) -> Union[None,dict]:
Copy link
Contributor

@shantanu-deriv shantanu-deriv Jun 16, 2022

Choose a reason for hiding this comment

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

refactor it to the separate class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How ? Could you please give me soem psudo-code ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean write a new middleware class and add this method there

Copy link
Contributor Author

@chylli-deriv chylli-deriv Jun 23, 2022

Choose a reason for hiding this comment

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

ok got your idea.
Let me do it.
But when I implement this feature, in js version I didn't find any place that this feature is used. I suspect it is useless. I even don't know I should keep this feature or not :(

Copy link
Contributor

Choose a reason for hiding this comment

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

middlewares are useful when used stack-like manner, allowing you to perform actions downstream then filter and manipulate the response upstream. This means in a small workflow like this is not much need but keeping in mind the future, its okay

'deriv_api.deriv_api.DerivAPI.wsconnection': False,
'deriv_api.deriv_api.DerivAPI.storage': False
'deriv_api.deriv_api.DerivAPI.storage': False,
'deriv_api.deriv_api.DerivAPI._call_middleware': False

Choose a reason for hiding this comment

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

Why the naming convention is different from others? Why not use deriv_api.deriv_api.DerivAPI.middleware

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry this is the old name that should be deleted.
will drop it.

@raunakkathuria raunakkathuria merged commit d68358e into deriv-com:master Aug 16, 2022
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.

3 participants