You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current calling solutions uses feign + hystrix - typical hybrid and advanced solutions when retrofit using it. All solutions are handling on Dynamice Proxy Classes using Annotations in Runtime. But I didn't see any RequestBuild thing solution for specific methods, only putting some null variables when we didn't overload methods when null is not nessecarly (we don't need them). To solving any painful searching solutions, I try solving it using OUR own HttpClient. Each request are returns Rest<T> class call (where T is returned type of call). Also I have some other ideas. Not only our new HttpClient too. Merging auth and external dependency eventmanager to new core project. And managable SocketClient in our way.
HttpClient
Client will always returns Rest class call to resolving response sync (get / execute) or async (enqueue), with mapping them and resolving mappings after calling response. Also we can delay our response using Duration. We can complexing our Rest class call to reactive results too using defined methods.
Internal EventManager
Currently eventmanager uses as external dependency. Merging it will solving some download dependency problems and it will be internal with the project. Some users doesn't like download additional dependency for that. "for that" I mean.
auth project migration
auth project should be together with core project. Also we can create interface for caching token into variate solution. We can cache only one AppCredential and it will serve for service-only solutions and projects, providing for App Token only calls. Also we can use Predicate to getting stored credential or trying remove them from stored interface.
Custom SocketClient
You can name it as WebSocketClient. Our customization allows uses internal calls (using jre HttpClient's) or external depends: okhttp or nv-websocket-client. With okhttp we can easily build WebSocket interface with no complexity (you can proxing same way like using like this) . nv-websocket-client is a complex. Storing our address, event (not our lib event), and proxy data, and throws Exception if we trying uses WebSocketFactory#createSocket, we wanna try avoid that and move definition to method (not into constructor). JRE 11 have own WebSocket client so we can provide it too, if it is possible.
Solutions
Creates our HttpClient which are returns Rest<T> class call (where T is returned type of call)
Rest can be mapped using map or flatMap
Rest have handlers for successful onSuccesss, throwable onError (with specific error type) and onComplete
Rest call can be freezed before call using Duration for specific time
Rest can having caching solutions for many entries
No more external eventmanager dependency. EventManager only inside the library.
using lists, reactive, coroutines or else.
Creating LoggingEventManager for logging and debugging events
Adding new events for calling Rest interaction (creating, executing, callbacking, mapping etc.)
Merge auth project to new core project
Adding TokenCache with search result using Predicate, id or login and and caching AppCredential for application
creating URL using CodeFlowRequest
Creates our SocketClient using 3 ways: okhttp, [Socket (for jre8)/ WebSocket (for jre11)] or nv-websocket-client
Alternatives
Sitting and thingking about how to reporoduce those methods when users doesn't needs adding nulls to request or what else. Or try replicate methods when javadoc will be expanded and overloaded with data.
TL;DR If you think it is a joke, you are got damn right. 😄
Additional context
This schematic is a only prototype. They can be changed in time:
Legend:
All fields have getters / setters + - public # - protected - - private
The solution needs to discuss
Sample calls:
helix.getModerators(credential, spec -> { // method will reads user id and token from credentialspec.limit = 100// limit for each page or none if you wanna caching them allspec.userId = Arrays.asList(208416203, 541118541) // filter by user id
}) // returns Rest<List<Moderator>> or IterableRest<Moderator>
.enqueue(Duration.ofSeconds(10), response -> {}, error -> {}) // after 10 seconds will consume on response, otherwise will throws on error consumer// .forEach(result -> {}) // if it is IterableRest
The text was updated successfully, but these errors were encountered:
stachu540
changed the title
Rebuilding project with new solutions
Refactor project with new solutions
Jan 3, 2021
Client code will be provided as private repository. Maintainers have access to this repo. After some clarification for this changes we will provide some proposal changes and improvements to this repository.
Provided code will be supports with streamlabs4j
And also planning improvements for Kotlin developers to improve his source code with external functions.
Prerequisites
Description
Current calling solutions uses
feign
+hystrix
- typical hybrid and advanced solutions whenretrofit
using it. All solutions are handling on Dynamice Proxy Classes usingAnnotations
inRuntime
. But I didn't see anyRequestBuild
thing solution for specific methods, only putting somenull
variables when we didn't overload methods whennull
is not nessecarly (we don't need them). To solving any painful searching solutions, I try solving it using OUR ownHttpClient
. Each request are returnsRest<T>
class call (whereT
is returned type of call). Also I have some other ideas. Not only our newHttpClient
too. Mergingauth
and external dependencyeventmanager
to newcore
project. And managableSocketClient
in our way.HttpClient
Client will always returns
Rest
class call to resolving response sync (get
/execute
) or async (enqueue
), with mapping them and resolving mappings after calling response. Also we can delay our response usingDuration
. We can complexing ourRest
class call to reactive results too using defined methods.Internal
EventManager
Currently
eventmanager
uses as external dependency. Merging it will solving some download dependency problems and it will be internal with the project. Some users doesn't like download additional dependency for that. "for that" I mean.auth
project migrationauth
project should be together withcore
project. Also we can create interface for caching token into variate solution. We can cache only oneAppCredential
and it will serve for service-only solutions and projects, providing for App Token only calls. Also we can usePredicate
to getting stored credential or trying remove them from stored interface.Custom
SocketClient
You can name it as
WebSocketClient
. Our customization allows uses internal calls (using jre HttpClient's) or external depends:okhttp
ornv-websocket-client
. Withokhttp
we can easily buildWebSocket
interface with no complexity (you can proxing same way like using like this) .nv-websocket-client
is a complex. Storing our address, event (not our lib event), and proxy data, and throws Exception if we trying usesWebSocketFactory#createSocket
, we wanna try avoid that and move definition to method (not into constructor). JRE 11 have ownWebSocket
client so we can provide it too, if it is possible.Solutions
HttpClient
which are returnsRest<T>
class call (whereT
is returned type of call)Rest
can be mapped usingmap
orflatMap
Rest
have handlers for successfulonSuccesss
, throwableonError
(with specific error type) andonComplete
Rest
call can be freezed before call usingDuration
for specific timeRest
can having caching solutions for many entrieseventmanager
dependency.EventManager
only inside the library.LoggingEventManager
for logging and debugging eventsRest
interaction (creating, executing, callbacking, mapping etc.)auth
project to newcore
projectTokenCache
with search result usingPredicate
,id
orlogin
and and cachingAppCredential
for applicationCodeFlowRequest
SocketClient
using 3 ways:okhttp
, [Socket
(for jre8)/WebSocket
(for jre11)] ornv-websocket-client
Alternatives
Sitting and thingking about how to reporoduce those methods when users doesn't needs adding
nulls
to request or what else. Or try replicate methods when javadoc will be expanded and overloaded with data.TL;DR If you think it is a joke, you are got damn right. 😄
Additional context
This schematic is a only prototype. They can be changed in time:
Legend:
All fields have getters / setters
+
- public#
- protected-
- privateThe solution needs to discuss
Sample calls:
The text was updated successfully, but these errors were encountered: