---
schema_version: "1"
id: c7c90d6b5014c12746306fcb818ffe721d9cbd5a07fa25f8ee62e5a75839c7b6
title: AsyncUtils ReadMe (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_asyncutils_readme.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_asyncutils_readme.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 45a26f04cadf3b06d7185923461ec2388cc4ef085270ea1662098836b9ef6297
description: For the managed package runtime, this page contains an AsyncUtils ReadMe for each Vlocity release.
products:
  - Omnistudio
release: "264"
---
# AsyncUtils ReadMe (Managed Package)

For the managed package runtime, this page contains an AsyncUtils ReadMe for each Vlocity release.

![Managed Package app icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/resources-global/_corporate/images/managedpackageicon.png) This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see [Omnistudio Help](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_standard.htm&language=en_US).

## Vlocity Insurance and Health Spring '20

This module exposes a collection of utilities designed to simplify asynchronous operations.

## ns/asyncUtils.debounce(func, wait, immediate)

Delay the execution of a function for the given amount of time. Use to throttle the the call rate of a method that can be repeatedly called.

Kind: static method of ns/asyncUtils

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col>
          <col>
          <col>
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d245784e66">
              <p style="margin-bottom:0;">Param</p>
            </th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d245784e72">
              <p style="margin-bottom:0;">Type</p>
            </th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d245784e78">
              <p style="margin-bottom:0;">Description</p>
            </th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Param" class="slds-cell-wrap" style="vertical-align:top;" headers="d245784e66 ">
              <p style="margin-bottom:0;">func</p>
            </td>

            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d245784e72 ">
              <p style="margin-bottom:0;">function</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d245784e78 ">
              <p style="margin-bottom:0;">Function to execute after the given duration.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Param" class="slds-cell-wrap" style="vertical-align:top;" headers="d245784e66 ">
              <p style="margin-bottom:0;">wait</p>
            </td>

            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d245784e72 ">
              <p style="margin-bottom:0;">number</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d245784e78 ">
              <p style="margin-bottom:0;">Time in milliseconds to delay.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Param" class="slds-cell-wrap" style="vertical-align:top;" headers="d245784e66 ">
              <p style="margin-bottom:0;">immediate</p>
            </td>

            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d245784e72 ">
              <p style="margin-bottom:0;">boolean</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d245784e78 ">
              <p style="margin-bottom:0;">When true, will execute on the front end onf the duration instead of after.</p>
            </td>

          </tr>
        </tbody>
      </table>

## ns/asyncUtils.delay(waitFor, \[result\])

Delays execution in the form of a promise.

Kind: static method of ns/asyncUtils

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col>
          <col>
          <col>
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d245784e177">
              <p style="margin-bottom:0;">Param</p>
            </th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d245784e183">
              <p style="margin-bottom:0;">Type</p>
            </th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d245784e189">
              <p style="margin-bottom:0;">Description</p>
            </th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Param" class="slds-cell-wrap" style="vertical-align:top;" headers="d245784e177 ">
              <p style="margin-bottom:0;">waitFor</p>
            </td>

            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d245784e183 ">
              <p style="margin-bottom:0;">number</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d245784e189 ">
              <p style="margin-bottom:0;">Number of milliseconds to delay by.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Param" class="slds-cell-wrap" style="vertical-align:top;" headers="d245784e177 ">
              <p style="margin-bottom:0;">[result]</p>
            </td>

            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d245784e183 ">
              <p style="margin-bottom:0;">*</p>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d245784e189 ">
              <p style="margin-bottom:0;">Pass through a previous result.</p>
            </td>

          </tr>
        </tbody>
      </table>