django_notification 모듈을 사용하고 있습니다. https://github.com/pinax/django-notification/blob/master/docs/usage.txt이 장고 문서를 이해할 수 없습니다. 이 모듈을 어떻게 사용합니까?
이 뭔가 일이 발생했을 때 사용자에게 이메일을 보내 내 코드에서 할 것입니다 :
notification.send([to_user], "comment_received", noti_dict)
을하지만,이 요청을 차단하는 것 같다. 그리고 그것을 보내려면 시간이 오래 걸립니다. 나는 문서를 읽고 그것을 대기열 (비동기)에 추가 할 수 있다고 말한다. 비동기 대기열에 어떻게 추가합니까?
나는 문서가 말하는 것을 이해하지 못한다. "emit_notices"란 무엇입니까? 내가 언제 불러? 5 초마다 호출하는 스크립트가 있습니까? 바보 같아. 비동기 적으로 수행하는 올바른 방법은 무엇입니까? 나는 무엇을해야합니까?
Lets first break down what each does.
``send_now``
~~~~~~~~~~~~
This is a blocking call that will check each user for elgibility of the
notice and actually peform the send.
``queue``
~~~~~~~~~
This is a non-blocking call that will queue the call to ``send_now`` to
be executed at a later time. To later execute the call you need to use
the ``emit_notices`` management command.
``send``
~~~~~~~~
A proxy around ``send_now`` and ``queue``. It gets its behavior from a global
setting named ``NOTIFICATION_QUEUE_ALL``. By default it is ``False``. This
setting is meant to help control whether you want to queue any call to
``send``.
``send`` also accepts ``now`` and ``queue`` keyword arguments. By default
each option is set to ``False`` to honor the global setting which is ``False``.
This enables you to override on a per call basis whether it should call
``send_now`` or ``queue``.