Commit Graph

68 Commits (fea12a60302fe1e8c331434422f598b6018fa05f)

Author SHA1 Message Date
David Wilson fea12a6030 Many updates: graceful shutdown, docs, threading
* Start splitting docs up into internals.rst / api.rst
* Docs for lots more of econtext.core.
* Get rid of _update_stream() and has_output(), replace with individual
  functions called as state changes.
* Add Broker.on_thread() and remove Stream._lock: simply call
  on_thread() to ensure buffer management is linearized.
* Rename read_side/write_side to receive_side/transmit_side like event
  handler names.
* Clean up some more repr / debug logs.
* Move handle cleanup to Context.on_shutdown where it belongs.
* Make wake() a noop when called from broker thread.
* Replace graceful_count crap with Side.graceful attribute, add
  Broker.keep_alive() to check whether any registered readers want to
  be kept alive for graceful shutdown() or any child contexts with a
  connected stream exist.
* Make master.Broker timeout slightly longer than slave broker.
* Add generic on_thread() to allow running code on the IO thread.
9 years ago
David Wilson f83c7c4802 Don't bury EBADF errors. 9 years ago
David Wilson 54b97b12ac Remove pointless _put_reply wrapper. 9 years ago
David Wilson 7c80ca37fd Replace Context lock with code that always runs under GIL 9 years ago
David Wilson a8928b8e05 Remove completely pointless _update_stream lock. 9 years ago
David Wilson 9b4183ddc4 Fix another race.
on_transmit() buffer mutation must be linearized with enqueue() buffer
mutation.
9 years ago
David Wilson 0e38d1f3e3 Remove needless long prefix. 9 years ago
David Wilson ac2a52587b s/wait/join/ 9 years ago
David Wilson 54b0a0aed7 Gracefully handle callback crashes. 9 years ago
David Wilson 2703e444ef Module importer fixes.
* Use TLS to track whether importer is currently running. Avoids
  needing to maintain an ignore stack.

* Print more debugging around cases where Importer skips a module.

* If a module is part of a package, import the package and examine its
  __loader__. If we are not the loader, refuse to load it.
9 years ago
David Wilson e422dedab8 Replace private lock with global importer lock. 9 years ago
David Wilson f88b0a11e9 Python 2.4 fixes. 9 years ago
David Wilson 1bc8681cb4 More doc updates. 9 years ago
David Wilson 6a01ae03e3 Replace SHUTDOWN with Channel.send(_DEAD) 9 years ago
David Wilson da4e457247 More docs, move call/call_with_deadline to econtext.master. 9 years ago
David Wilson c607831561 SlaveModuleImporter->Importer, enable intersphinx, finish howitworks.rst. 9 years ago
David Wilson 737d095ffc More docs. 9 years ago
David Wilson 63ee222406 Many docs updates. 9 years ago
David Wilson 8ba5fbf27f Get rid of CorruptMessageError. 9 years ago
David Wilson 73c418ef4b Rename ContextError -> Error. 9 years ago
David Wilson 052c96d7ee Allow importing master's __main__. 9 years ago
David Wilson 8afa1327fb Move wait() to correct location. 9 years ago
David Wilson dd03183022 Remove needless setup work. 9 years ago
David Wilson ce27058bdf Initial intro doc. 9 years ago
David Wilson d457c20d87 Naming/docstring tidyups. 9 years ago
David Wilson d2fa9ba2aa Tidy. 9 years ago
David Wilson cc18ab5e28 Tidy up event names and docstrings. 9 years ago
David Wilson 663eb01518 Docstring fixes. 9 years ago
David Wilson d6d13ee506 Rationalize _fixup_package(), fix _setup_master() name. 9 years ago
David Wilson 0e58a48611 Fix method naming everywhere. 9 years ago
David Wilson 4b11023558 flake8 9 years ago
David Wilson 6f1b6df0f9 Don't leak slave's main IO streams. 9 years ago
David Wilson 70c2032bb2 Another hackish graceful shutdown method. 9 years ago
David Wilson 4e5add97e5 Seemingly robust graceful shutdown. 9 years ago
David Wilson 98f5cdc9fc Tweak timeotu. 9 years ago
David Wilson 9a8fc5e167 Another attempt at graceful shutdown. 9 years ago
David Wilson 4947fb2c40 Rename PutReply for log readability. 9 years ago
David Wilson 397275087b Fix name. 9 years ago
David Wilson f4fa69075e Remove unused signal.signal(). 9 years ago
David Wilson 14b0b0d008 Remove unused ReadMore(). 9 years ago
David Wilson fa0beffac2 Fix stdout reopen when stdout is a socket. 9 years ago
David Wilson 625bec9db5 Remove wait= from Finalize(), main() try/except. 9 years ago
David Wilson d8b6aa8902 Beginnings of graceful shutdown. 9 years ago
David Wilson 8a081a103f Python 2.4 open() vs. file(). 9 years ago
David Wilson 82a31cfb7a Tidy up _ReceiveOne() logic. 9 years ago
David Wilson f93839c318 Fix variable name. 9 years ago
David Wilson d4875fdec7 Fix obvious importer bug. 9 years ago
David Wilson bca3a65157 Use set_cloexec() everywhere. 9 years ago
David Wilson 6bedfe1934 Fix input length check error. 9 years ago
David Wilson eeecf0f984 Simplify module loader (master already checked in) 9 years ago