Skip to content

Add a series of technical guides to the project#1162

Open
sugmanue wants to merge 1 commit intosmithy-lang:mainfrom
sugmanue:sugmanue/intro-docs
Open

Add a series of technical guides to the project#1162
sugmanue wants to merge 1 commit intosmithy-lang:mainfrom
sugmanue:sugmanue/intro-docs

Conversation

@sugmanue
Copy link
Copy Markdown
Contributor

Issue #, if available:

Add a series of technical guides to the project

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

I input, ApiOperation<I, O> operation, RequestOverrideConfig overrideConfig)
```

This is the entry point for all RPC calls:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey @sugmanue, may I ask your/the team vision this method. Currently it is marked as protected and I understand that the main purpose of this is to allow derived "impl" classes to call it, but also in theory it is possible to override it during the codegen to have some extra logic in it (and still call the original method from the base-class):

<I extends SerializableStruct, O extends SerializableStruct> O call(
      I input,
      ApiOperation<I, O> operation,
      RequestOverrideConfig overrideConfig
  ) {
    // some logic here
    return super.call(input, operation, overrideConfig);
  }

If you think that this is a possibility, would it be possible to expose RequestOverrideConfig fields to external consumers (or at least context getter)? Currently every getter in this class is package-private so it is not possible to access them from the outside (e.g. to get the context which was previously set by custom settings set by defaultSettings (similar to

"defaultSettings": [
"software.amazon.smithy.java.aws.client.auth.scheme.sigv4.SigV4Settings"
],
). I understand that the main approach for this type of tasks should be using an interceptor, but when integrating into an existing system it is not always possible and some libraries require to wrap a call so that the context is correctly "scoped". Otherwise it would require either consumers to wrap every client call manually (which is prone to errors) or doing a refactoring on such libraries to allow to "split" their logic into separate phases (how the interceptor works).

Thanks!

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