private async dispatch()

in src/dispatch/Dispatch.ts [171:190]


    private async dispatch(
        send: SendFunction
    ): Promise<{ response: HttpResponse }> {
        if (!this.enabled) {
            return;
        }

        if (!this.eventCache.hasEvents()) {
            return;
        }

        const putRumEventsRequest: PutRumEventsRequest = {
            BatchId: v4(),
            AppMonitorDetails: this.eventCache.getAppMonitorDetails(),
            UserDetails: this.eventCache.getUserDetails(),
            RumEvents: this.eventCache.getEventBatch()
        };

        return send(putRumEventsRequest);
    }