open method
- IContext? context
override
Opens the component.
context
(optional) a context to trace execution through call chain. Return Future that receives null no errors occured. Throws error
Implementation
@override
Future open(IContext? context) async {
if (isOpen()) {
return;
}
connection = await connectionResolver.resolve(context);
headers['x-functions-key'] = connection!.getAuthCode()!;
uri = connection?.getFunctionUri();
try {
client = http.Client();
logger.debug(context, 'Azure Function client connected to %s',
[connection?.getFunctionUri()]);
} catch (ex) {
client = null;
logger.error(context, ApplicationException().wrap(ex),
'Error while open Azure Function client');
return ex;
}
}