Skip to content
Snippets Groups Projects
Commit 08b5abca authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

changed semantics of wrap_future, docs fix

parent 117b4f30
No related branches found
No related tags found
No related merge requests found
# v2.15.8 # v2.16
* changed semantics of `wrap_future`
...@@ -242,7 +242,8 @@ Useful data structures ...@@ -242,7 +242,8 @@ Useful data structures
Sometimes you want to have some data structures with metrics about themselves. Sometimes you want to have some data structures with metrics about themselves.
Here go they: Here go they:
.. autoclass:: satella.instrumentation.metrics.structures.MetrifiedThreadPool .. autoclass:: satella.instrumentation.metrics.structures.MetrifiedThreadPoolExecutor
:members:
.. autoclass:: satella.instrumentation.metrics.structures.MetrifiedCacheDict .. autoclass:: satella.instrumentation.metrics.structures.MetrifiedCacheDict
......
__version__ = '2.15.8a1' __version__ = '2.16a1'
...@@ -6,14 +6,15 @@ from .common import ResponseFuture ...@@ -6,14 +6,15 @@ from .common import ResponseFuture
def wrap_future(future: ResponseFuture) -> Future: def wrap_future(future: ResponseFuture) -> Future:
""" """
Convert a Cassandra's future to a normal Python future. Convert a Cassandra's future to a normal Python future.
The future is returned already The returned future will be marked as running.
future is returned when it's already a Python future.
:param future: cassandra future to wrap :param future: cassandra future to wrap
:return: a standard Python future :return: a standard Python future
:raises TypeError: when a normal Python future is passed as future
""" """
if isinstance(future, Future): if isinstance(future, Future):
raise TypeError('Tried to wrap an existing Future!') return future
fut = Future() fut = Future()
fut.set_running_or_notify_cancel() fut.set_running_or_notify_cancel()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment