mikuso / ocpp-rpc

A Node.js client & server implementation of the WAMP-like RPC-over-websocket system defined in the OCPP-J protocols.
MIT License
98 stars 29 forks source link

Can handlers be asynchronous? #48

Closed owen95t closed 1 year ago

owen95t commented 1 year ago

As per title, on receipt of a StartTransaction.req from the charger, I need to do some logic to get the id of the transaction and this logic is asynchronous. Can this be done? Thank you

mikuso commented 1 year ago

Yes. You simply need to return a Promise from your handler.

owen95t commented 1 year ago

@mikuso Thank you!