Concurrency API for Swiftly.
Copyright 2011-2013 Gregory Holt
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
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.
Bases: object
Convenience class to support concurrency, if Eventlet is available; otherwise it just performs at single concurrency.
Parameters: | concurrency – The level of concurrency desired. Default: 10 |
---|
Returns a dict of the results currently available. The keys are the ident values given with the calls to spawn. The values are tuples of (exc_type, exc_value, exc_tb, result) where:
exc_type | The type of any exception raised. |
exc_value | The actual exception if any was raised. |
exc_tb | The traceback if any exception was raised. |
result | If no exception was raised, this will be the return value of the called function. |
Returns immediately to the caller and begins executing the func in the background. Use get_results and the ident given to retrieve the results of the func. If the func causes an exception, this exception will be caught and the sys.exc_info() will be returned via get_results.
Parameters: |
|
---|---|
Returns: | None |