Warning: Developer Pages

This page is part of a set of pages aimed at DWR developers. If this isn't you, then you probably want the documentation index.

The Anatomy of a Batch

The batch data structure has changed over time:

DWR 2.0RC1 and on

DWREngine._batch {
  async:<true|false>,
  completed:<true|false>,
  headers:{
    customHeaderName:customHeaderValue,
    ...
  },
  parameters:{
    customParameterName:customParameterValue,
    ...
  },
  ids:{
    id1:{
      callback:function() { ...}
      exceptionHandler:function() { ...}
    },
    ...
  },
  interval:{...},    // opaque type, only used with timeout
  map:{
    callCount:,
    cX-id:,
    cX-scriptName:,
    cX-methodName:,
    cX-paramY:,
  },
  method:,
  pageId:"...",
  paramCount:,
  path:,
  postHooks:[],
  preHooks:[],
  scriptSessionId:"...",
  httpSessionId:"...",
  timeout:<0..>,
  verb:<>
  errorHandler:function() { ...},
  warningHandler:function() { ...},
  textHtmlHandler:function() { ...},
}

DWR 1.0 to 2.0m3

DWREngine._batch {
  async:<true|false>,
  completed:<true|false>,
  headers:{
    customHeaderName:customHeaderValue
  },
  ids:[id1, id2, ...],
  interval:{...},       // opaque type, only used with timeout
  map:{
    callCount:,
    cX-id:,
    cX-scriptName:,
    cX-methodName:,
    cX-paramY:,
  },
  method:,
  pageId:"...",
  paramCount:,
  path:,
  postHooks:[],
  preHooks:[],
  scriptSessionId:"...",
  httpSessionId:"...",
  timeout:<0..>,
  verb:<>
}

The handlers map contains a list of callbacks that are about to be called.

DWREngine._handlersMap {
  id1:{
    errorHandler:function() { ...},
    warningHandler:function() { ...},
    callback:function() { ...}
  },
  id2:...
}