Defaulting request collection to the async channel such that the user need not call .flush()

This commit is contained in:
Bogdan Berce 2015-04-03 14:26:49 -07:00
Родитель 077c7771d6
Коммит 62097612e6
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -37,6 +37,10 @@ class WSGIApplication(object):
if not wsgi_application: if not wsgi_application:
raise Exception('WSGI application was required but not provided') raise Exception('WSGI application was required but not provided')
telemetry_channel = kwargs.pop('telemetry_channel', None) telemetry_channel = kwargs.pop('telemetry_channel', None)
if not telemetry_channel:
sender = applicationinsights.channel.AsynchronousSender()
queue = applicationinsights.channel.AsynchronousQueue(sender)
telemetry_channel = applicationinsights.channel.TelemetryChannel(None, queue)
self.client = applicationinsights.TelemetryClient(instrumentation_key, telemetry_channel) self.client = applicationinsights.TelemetryClient(instrumentation_key, telemetry_channel)
self._wsgi_application = wsgi_application self._wsgi_application = wsgi_application