Changeset 882 for branches


Ignore:
Timestamp:
Sep 13, 2018, 3:51:18 PM (6 years ago)
Author:
djay
Message:

Fix to use same default mode when memory is not set and service is run asynchronously. Add sleep function to the JS ZOO-API (for polling).

Location:
branches/prototype-v0/zoo-project/zoo-kernel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/prototype-v0/zoo-project/zoo-kernel/service_internal_js.c

    r863 r882  
    157157    return 1;
    158158  if (!JS_DefineFunction(cx, global, "alert", JSAlert, 2, 0))
     159    return 1; 
     160  if (!JS_DefineFunction(cx, global, "sleep", JSSleep, 1, 0))
    159161    return 1; 
    160162  if (!JS_DefineFunction(cx, global, "importScripts", JSLoadScripts, 1, 0))
     
    10271029}
    10281030
     1031/**
     1032 * The function used as sleep from the JavaScript environment
     1033 * (ZOO-API).
     1034 *
     1035 * @param cx the JavaScript context
     1036 * @param argc the number of parameters
     1037 * @param argv1 the parameter values
     1038 * @return true
     1039 */
     1040JSBool
     1041JSSleep(JSContext *cx, uintN argc, jsval *argv1)
     1042{
     1043  jsval *argv = JS_ARGV(cx,argv1);
     1044  JS_MaybeGC(cx);
     1045  int isleep=0;
     1046  if(JS_ValueToInt32(cx,argv[0],&isleep)==JS_TRUE){
     1047    zSleep(isleep);
     1048  }
     1049  JS_MaybeGC(cx);
     1050  return JS_TRUE;
     1051}
     1052
  • branches/prototype-v0/zoo-project/zoo-kernel/service_internal_js.h

    r580 r882  
    4949  JSBool JSRequest(JSContext*, uintN, jsval*);
    5050  JSBool JSUpdateStatus(JSContext*,uintN,jsval *);
     51  JSBool JSSleep(JSContext*,uintN,jsval *);
    5152
    5253  void reportError(JSContext *cx, const char *message, JSErrorReport *report);
  • branches/prototype-v0/zoo-project/zoo-kernel/zoo_service_loader.c

    r881 r882  
    25682568          }else{
    25692569            map* testMap=getMapFromMaps(m,"main","memory");
    2570             if(testMap!=NULL && strcasecmp(testMap->value,"load")!=0)
     2570            if(testMap==NULL || strcasecmp(testMap->value,"load")!=0)
    25712571              dumpMapsValuesToFiles(&m,&request_input_real_format);
    25722572            loadServiceAndRun (&m, s1, request_inputs,
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png