In ocpp v2 library - MultiProtocolSessionFactory doesnt support requests synchronously #358
Unanswered
suresh14pamujula
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
It appears that in ocpp v2 library, there is no support for requests synchronously. Below is the code for quick reference.
In case we need synchronous support - how this can be achieved?
`
/**
Creates a server session
The session will use the feature repository for the given {https://github.com/link ProtocolVersion}.
@param communicator the {https://github.com/link Communicator} to use for the server session
@param protocolVersion the {https://github.com/link ProtocolVersion} to use for the server session
@return the server {https://github.com/link Session}
*/
public ISession createSession(Communicator communicator, ProtocolVersion protocolVersion) {
IFeatureRepository featureRepository =
multiProtocolFeatureRepository.getFeatureRepository(protocolVersion);
AsyncPromiseFulfillerDecorator promiseFulfiller =
new AsyncPromiseFulfillerDecorator(new SimplePromiseFulfiller());
return new Session(communicator, new Queue(), promiseFulfiller, featureRepository);
}
`
Beta Was this translation helpful? Give feedback.
All reactions