ソースを参照

Use vine for promises

Ask Solem 9 年 前
コミット
22eba29948

+ 1 - 1
celery/app/base.py

@@ -16,11 +16,11 @@ from collections import defaultdict, deque
 from operator import attrgetter
 from functools import wraps
 
-from amqp import starpromise
 from kombu import pools
 from kombu.clocks import LamportClock
 from kombu.common import oid_from
 from kombu.utils import cached_property, register_after_fork, uuid
+from vine import starpromise
 
 from celery import platforms
 from celery import signals

+ 1 - 1
celery/canvas.py

@@ -20,8 +20,8 @@ from functools import partial as _partial, reduce
 from operator import itemgetter
 from itertools import chain as _chain
 
-from amqp.promise import barrier
 from kombu.utils import cached_property, fxrange, reprcall, uuid
+from vine import barrier
 
 from celery._state import current_app
 from celery.local import try_import

+ 2 - 1
celery/concurrency/asynpool.py

@@ -33,7 +33,6 @@ from pickle import HIGHEST_PROTOCOL
 from time import sleep
 from weakref import WeakValueDictionary, ref
 
-from amqp import promise
 from billiard.pool import RUN, TERMINATE, ACK, NACK, WorkersJoined
 from billiard import pool as _pool
 from billiard.compat import buf_t, setblocking, isblocking
@@ -42,6 +41,8 @@ from kombu.async import READ, WRITE, ERR
 from kombu.serialization import pickle as _pickle
 from kombu.utils import fxrange
 from kombu.utils.eventio import SELECT_BAD_FD
+from vine import promise
+
 from celery.five import Counter, items, values
 from celery.utils.functional import noop
 from celery.utils.log import get_logger

+ 1 - 1
celery/result.py

@@ -14,8 +14,8 @@ from collections import OrderedDict, deque
 from contextlib import contextmanager
 from copy import copy
 
-from amqp.promise import Thenable, promise
 from kombu.utils import cached_property
+from vine import Thenable, promise
 
 from . import current_app
 from . import states

+ 1 - 1
celery/tests/app/test_app.py

@@ -7,7 +7,7 @@ import itertools
 from copy import deepcopy
 from pickle import loads, dumps
 
-from amqp import promise
+from vine import promise
 
 from celery import Celery
 from celery import shared_task, current_app

+ 1 - 1
celery/utils/functional.py

@@ -19,10 +19,10 @@ except ImportError:  # Py2
     from inspect import isfunction, getargspec  # noqa
 from itertools import chain, islice
 
-from amqp import promise
 from kombu.utils.functional import (
     dictfilter, lazy, maybe_evaluate, is_list, maybe_list,
 )
+from vine import promise
 
 from celery.five import UserDict, UserList, keys, range
 

+ 1 - 1
celery/worker/consumer/consumer.py

@@ -17,7 +17,6 @@ import os
 from collections import defaultdict
 from time import sleep
 
-from amqp.promise import ppartial, promise
 from billiard.common import restart_state
 from billiard.exceptions import RestartFreqExceeded
 from kombu.async.semaphore import DummyLock
@@ -25,6 +24,7 @@ from kombu.five import buffer_t, items
 from kombu.syn import _detect_environment
 from kombu.utils.encoding import safe_repr, bytes_t
 from kombu.utils.limits import TokenBucket
+from vine import ppartial, promise
 
 from celery import bootsteps
 from celery import signals

+ 1 - 0
docs/conf.py

@@ -76,6 +76,7 @@ intersphinx_mapping = {
     'djcelery': ('http://django-celery.readthedocs.org/en/master', None),
     'cyme': ('http://cyme.readthedocs.org/en/latest', None),
     'amqp': ('http://amqp.readthedocs.org/en/latest', None),
+    'vine': ('http://vine.readthedocs.org/en/latest', None),
     'flower': ('http://flower.readthedocs.org/en/latest', None),
 }
 

+ 2 - 1
requirements/dev.txt

@@ -1,3 +1,4 @@
-https://github.com/celery/py-amqp/zipball/master
 https://github.com/celery/billiard/zipball/master
 https://github.com/celery/kombu/zipball/master
+https://github.com/celery/py-amqp/zipball/master
+https://github.com/celery/vine/zipball/master