Skip to content

Extend batch protocol #153

@ilinkuo

Description

@ilinkuo

From the discussion on #152, this proposal aims to:

  • extend batching to data and html requests
  • support/prefer static manifests

The benefits, in addition to the benefits of a static manifest, are that server traffic subsequent to the initial manifest load is also greatly reduced.

  1. AppConfig.manifestUrl [mandatory] becomes a static url for retrieving the static manifest.
  2. AppConfig.batchUrl [optional] is a new url for retrieving optionally supported batch functionality.
  3. F2 adds a new batch method with signature F2.batch(url, params, type, [delay], [callback], [errback]) and opens up the batch request mechanism to
    • Type can be manifest(default), combo, html, data. A manifest request is a static manifest request. If data and html are provided for a static manifest request, then these should be non-changing values (for example, html for a waiting icon, or sample data for a demo App, with real data protected by authentication on a data request) A combo request is the current mix of manifest plus dynamic html and data.
    • Like the existing registerApps, batches are grouped by having a common batchUrl.
    • The target server side batchUrl knows how to decode a batch request into its component requests. This isn't spelled out in the current spec, but I think F2 needs to explicitly spell this out.
    • The response is an array of static manifests, combination manifests, html, or data. Today, the response is an array of dynamic manifests only.
    • The handling of each element of the response array is by either a user specified callback handler, or a default handler for the type. The default handler for the type combo is just the current _loadApps(). Note how the _loadApps() takes an array of AppConfigs and an array of AppManifests which is just the response? Well, the handling of the combined response just takes an array of handers and the response's array of objects. Each AppConfig is easily made into a handler using something like var handler = new ComboManifestHandler(appConfig);
    • Batch requests are given a slight delay so that multiple requests have a chance of being batched.
    • An alternate signature for batch could use a promise instead of explicit callback and errback parameters.
  4. The current batch loading of manifests is rewritten to use the new F2.batch() to do the actual work
  5. AppConfig.batchUrl should in most cases, be a remembered value from having read in AppManifest.batchUrl (or via some out-of-band communication, as it is currently). The manifest server indicates whether or not it supports batch requests by providing AppManifest.batchUrl. If provided, AppManifest,batchUrl != AppManifest.manifestUrl because the latter points to a static resource. However, the Container may implement its own batch request aggregation irregardless of whether the App Server does so by providing an AppConfig.batchUrl. In this case, AppConfig.batchUrl != AppManifest.batchUrl.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions