Commit Graph

13 Commits (6fb3a76e68d3e6f54500a971dc7e17b3306c4879)

Author SHA1 Message Date
David Wilson 7c88e4d013 Move _DEAD into header, autogenerate dead messages
This change blocks off 2 common scenarios where a race condition is
upgraded to a hang, when the library could internally do better.

* Since we don't know whether the receiver of a `reply_to` is expecting
  a raw or pickled message, and since in the case of a raw reply, there
  is no way to signal "dead" to the receiver, override the reply_to
  field to explicitly mark a message as dead using a special handle.

  This replaces the serialized _DEAD sentinel value with a slightly
  neater interface, in the form of the reserved IS_DEAD handle, and
  enables an important subsequent change: when a context cannot route a
  message, it can send a generic 'dead' reply back towards the message
  source, ensuring any sleeping thread is woken with ChannelError.

  The use of this field could potentially be extended later on if
  additional flags are needed, but for now this seems to suffice.

* Teach Router._invoke() to reply with a dead message when it receives a
  message for an invalid local handle.

* Teach Router._async_route() to reply with a dead message when it
  receives an unroutable message.
7 years ago
David Wilson 7ab1af043e ansible: redirect logging into display 'framework'. closes #111 7 years ago
David Wilson ff617824a1 ansible: fix some flake8 errors
* Unused imports
* Undefined names in helpers.py
* Copyright header wrapping
7 years ago
David Wilson b221eaaa10 ansible: log call timings 7 years ago
David Wilson 91116810a1 ansible: delete utils.py and promote cast() to mitogen.utils 7 years ago
David Wilson 18eaf14dca ansible: migrate logging variables into utils. 7 years ago
David Wilson 09eb3fd9ba utils: support log_to_file(usec=True) 7 years ago
David Wilson 326886832e Add license text everywhere. 7 years ago
David Wilson 6a10ab605e docs: move mitogen.utils docs to Sphinx. 7 years ago
Alex Willmer d706b7d6b8 Update lingering references to with_broker & run_with_broker
A previous commit renamed run_with_broker() and with_broker() to
run_with_router() and with_router() respctively. Some references were
missed.
7 years ago
David Wilson b827ee1bc7 Delete mitogen.utils.log_to_tmp() 7 years ago
David Wilson 750e9fab24 Make log_to_file accept string level rather than logging package constant
Saves an import, pain in the ass to type all the time.
7 years ago
David Wilson e7ff6259a3 Initial commit. 7 years ago