[Zorba-coders] [Merge] lp:~zorba-coders/zorba/feature-sleep_module into lp:zorba
The proposal to merge lp:~zorba-coders/zorba/feature-sleep_module into lp:zorba has been updated. Status: Needs review => Merged For more details, see: https://code.launchpad.net/~zorba-coders/zorba/feature-sleep_module/+merge/216475 -- https://code.launchpad.net/~zorba-coders/zorba/feature-sleep_module/+merge/216475 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/feature-sleep_module into lp:zorba
Validation queue succeeded - proposal merged! -- https://code.launchpad.net/~zorba-coders/zorba/feature-sleep_module/+merge/216475 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/feature-sleep_module into lp:zorba
Validation queue result for https://code.launchpad.net/~zorba-coders/zorba/feature-sleep_module/+merge/216475 Stage "CommitZorba" failed. Check console output at http://jenkins.lambda.nu:8180/job/CommitZorba/320/console to view the results. -- https://code.launchpad.net/~zorba-coders/zorba/feature-sleep_module/+merge/216475 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/feature-sleep_module into lp:zorba
Validation queue starting for the following merge proposals: https://code.launchpad.net/~zorba-coders/zorba/feature-sleep_module/+merge/216475 Progress dashboard at http://jenkins.zorba.io:8180/view/ValidationQueue -- https://code.launchpad.net/~zorba-coders/zorba/feature-sleep_module/+merge/216475 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/feature-sleep_module into lp:zorba
Review: Approve -- https://code.launchpad.net/~zorba-coders/zorba/feature-sleep_module/+merge/216475 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/feature-sleep_module into lp:zorba
Voting criteria failed for the following merge proposals: https://code.launchpad.net/~zorba-coders/zorba/feature-sleep_module/+merge/216475 : Votes: {'Approve': 1} -- https://code.launchpad.net/~zorba-coders/zorba/feature-sleep_module/+merge/216475 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/feature-sleep_module into lp:zorba
Validation queue starting for the following merge proposals: https://code.launchpad.net/~zorba-coders/zorba/feature-sleep_module/+merge/216475 Progress dashboard at http://jenkins.zorba.io:8180/view/ValidationQueue -- https://code.launchpad.net/~zorba-coders/zorba/feature-sleep_module/+merge/216475 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/feature-sleep_module into lp:zorba
Validation queue result for https://code.launchpad.net/~zorba-coders/zorba/feature-sleep_module/+merge/216475 Stage "TestZorbaUbuntu" failed. 1 tests failed (8770 total tests run). Check test results at http://jenkins.lambda.nu:8180/job/TestZorbaUbuntu/498/testReport/ to view the results. -- https://code.launchpad.net/~zorba-coders/zorba/feature-sleep_module/+merge/216475 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/feature-sleep_module into lp:zorba
Matthias Brantner has proposed merging lp:~zorba-coders/zorba/feature-sleep_module into lp:zorba. Commit message: initial version of sleep module Requested reviews: Matthias Brantner (matthias-brantner) For more details, see: https://code.launchpad.net/~zorba-coders/zorba/feature-sleep_module/+merge/216475 initial version of sleep module -- https://code.launchpad.net/~zorba-coders/zorba/feature-sleep_module/+merge/216475 Your team Zorba Coders is subscribed to branch lp:zorba. === modified file 'modules/CMakeLists.txt' --- modules/CMakeLists.txt 2014-01-03 17:31:44 + +++ modules/CMakeLists.txt 2014-04-18 18:30:22 + @@ -27,6 +27,7 @@ ADD_SUBDIRECTORY(schema) ADD_SUBDIRECTORY(sctx) ADD_SUBDIRECTORY(sequence) +ADD_SUBDIRECTORY(sleep) ADD_SUBDIRECTORY(store) ADD_SUBDIRECTORY(structured-items) ADD_SUBDIRECTORY(uri) === added directory 'modules/sleep' === added file 'modules/sleep/CMakeLists.txt' --- modules/sleep/CMakeLists.txt 1970-01-01 00:00:00 + +++ modules/sleep/CMakeLists.txt 2014-04-18 18:30:22 + @@ -0,0 +1,21 @@ +# Copyright 2006-2014 The FLWOR Foundation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +DECLARE_ZORBA_MODULE( + FILE sleep.xq + URI "http://zorba.io/modules/sleep"; + VERSION 1.0 +) + +# vim:set et sw=2 ts=2: === added file 'modules/sleep/sleep.xq' --- modules/sleep/sleep.xq 1970-01-01 00:00:00 + +++ modules/sleep/sleep.xq 2014-04-18 18:30:22 + @@ -0,0 +1,41 @@ +xquery version "3.0"; + +(: + : Copyright 2006-2013 The FLWOR Foundation. + : + : Licensed under the Apache License, Version 2.0 (the "License"); + : you may not use this file except in compliance with the License. + : You may obtain a copy of the License at + : + : http://www.apache.org/licenses/LICENSE-2.0 + : + : Unless required by applicable law or agreed to in writing, software + : distributed under the License is distributed on an "AS IS" BASIS, + : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + : See the License for the specific language governing permissions and + : limitations under the License. +:) + +(:~ + : This module provides a function to put the currently running query + : to sleep. + : + :) +module namespace sleep = "http://zorba.io/modules/sleep";; + +declare namespace an = "http://zorba.io/annotations";; + +declare namespace ver = "http://zorba.io/options/versioning";; +declare option ver:module-version "1.0"; + +(:~ + : Puts the currently running query to sleep. + : This function is mainly useful in development e.g. to simulate the + : effects of long-running tasks wrt. the concurrent execution of + : requests. + : + : @param $millis the number of milliseconds to sleep + : @return the function is sequential and returns the empty sequence + :) +declare %an:sequential function sleep:millis($millis as xs:integer) + as empty-sequence() external; === added directory 'modules/sleep/sleep.xq.src' === added file 'modules/sleep/sleep.xq.src/sleep.cpp' --- modules/sleep/sleep.xq.src/sleep.cpp 1970-01-01 00:00:00 + +++ modules/sleep/sleep.xq.src/sleep.cpp 2014-04-18 18:30:22 + @@ -0,0 +1,116 @@ +/* + * Copyright 2006-2014 The FLWOR Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "sleep.h" + +#ifdef WIN32 +# include +#else +# include +#endif +#include +#include +#include +#include +#include + +namespace zorba { namespace sleep { + +MillisFunction::~MillisFunction() +{} + +zorba::ItemSequence_t +MillisFunction::evaluate( + const Arguments_t& aArgs, + const zorba::StaticContext*, + const zorba::DynamicContext*) const +{ + // getIntegerValue is not available in Zorba + // => get the string, parse it, and check the limits + Item lRequestItem; + Iterator_t arg0_iter = aArgs[0]->getIterator(); + arg0_iter->open(); + arg0_iter->next(lRequestItem); + arg0_iter->close(); + + std::stringstream lStream; + unsigned int lMillis; + + zorba::String lStringValue = lRequestItem.getStringValue(); + + bo
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/feature-sleep_module into lp:zorba
Validation queue starting for the following merge proposals: https://code.launchpad.net/~zorba-coders/zorba/feature-sleep_module/+merge/216475 Progress dashboard at http://jenkins.zorba.io:8180/view/ValidationQueue -- https://code.launchpad.net/~zorba-coders/zorba/feature-sleep_module/+merge/216475 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/feature-sleep_module into lp:zorba
Review: Approve -- https://code.launchpad.net/~zorba-coders/zorba/feature-sleep_module/+merge/216475 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp