* Rename protocols_handler.rs to protocols_handler/mod.rs
* Move DummyProtocolsHandler out of the module
* Extract ProtocolsHandlerSelect
* Extract NodeHandlerWrapper
* Add unit tests for core::nodes::NodeStream
* Move DummyMuxer to core/tests
* Address grumbles
* Impl Debug for SubstreamRef<P>
* Add test for poll()
* Don't need to open a substream
* pretty printer test
* More tests for NodeStream poll()
* ListenerStream unit tests: transport() and listeners()
* Tests for nodes/listeners.rs
* Add a few tests to help illustrate the "drowning" behaviour of busy listeners
* Tests for HandledNode
* Address grumbles
* Remove non-project specific stuff
* Address grumbles
* Prefer freestanding function
* Untangle the code for old shutdown test from the new tests
Add HandlerState and use it in TestBuilder
Shorter test names
* WIP – tests pass
* Use a newtype to lighten up the function signatures a bit
Test NotReady case
* Cleanup Event enum
Track events as they reach the Handler
Describe complex test logic
* Assert on the event trace
* More tests for poll()
* Switch to using usize as the OutboundOpenInfo so we can assert on event contents
More tests for poll()
* whitespace
* whitespace and spelling
* WIP tests for handled_node_tasks:Task
* wip
* Move Handler related code to dummy_handler
* Sort out the events going to/from node
* WIP tests for poll
* Add a TestBuilder for NodeTask tests
More NodeTask tests
* Fixes broken test after upstream changes
* Clarify the behaviour of is_shutting_down
* Fix broken test
* Test for task exit when muxers in- and outbound are closed
* Add question about impossible Async::NotReady
* Fix tests after recent changes on master
* Upstream changes
* Tests for HandledNodesTasks
* Add test for HandledNodesTasks poll
* Test we reach all nodes and then closed all nodes
* Test event emission by HandledNodesTasks
* Test starting CollectionStream
* Test that we can reach a peer after a successful connection
* Assert collection contains what we expect
* Test handler events get to the collectionstream
* Remaining tests for CollectionStream
* Run tests on single threaded runtime to avoid intermittent failures
* Remove call to shutdown – not needed
* No need to specify tokio version
* Change the DummyTransport Output type to match RawSwarm
* First few tests for RawSwarm
Whitespace: spaces
* Dummy impl of `dial()`
* Typos/grammar in docs
* Impl Debug for RawSwarmEvent and Peer
Test dialing peer without peer id
* Test num_incoming_negotiated
* A few more tests
* whitespace
* Add derive(Debug) for RawSwarm, ReachAttempts, PeerPendingConnect, PeerNotConnected
Fix intermittent test failures by polling repeatedly when getting NotReady
Add more tests
* Outline remaining work
* Test more error conditions
* wip
* Test error conditions
* Remove debug statements
* typo
* whitespace
* Use PeerId::random
* Uneeded dependency
* Use PeerId::random
* Somewhat less artificial nat_traversal test
* Use the IPv6 "black hole" prefix as an "unreachable" multiaddr
* Use a boolean on DummyTransport to make dial attempts fail
* No funny stuff for nat_traversal
* Add a floodsub example with the new Swarm
* WIP fixes for Floodsub chat-example code
* cleanup
* Address grumbles
* Update docs
* Update to newest master
The current implementation of `MapUpgradeErr` implements `InboundUpgrade`
and `OutboundUpgrade` and applies the transformation in both cases which
means that mapping is always applied to inbound and outbound upgrade
errors. This commit uses separate `MapInboundUpgradeErr` and
`MapOutboundUpgradeErr` types which implements both traits but only map
errors in one direction.
The current implementation of `MapUpgrade` implements `InboundUpgrade`
and `OutboundUpgrade` and applies the transformation in both cases which
means that mapping is always applied to inbound and outbound upgrades.
This commit uses separate `MapInboundUpgrade` and `MapOutboundUpgrade`
types which implements both traits but only map in one direction.
* Add unit tests for core::nodes::NodeStream
* Move DummyMuxer to core/tests
* Address grumbles
* Impl Debug for SubstreamRef<P>
* Add test for poll()
* Don't need to open a substream
* pretty printer test
* More tests for NodeStream poll()
* ListenerStream unit tests: transport() and listeners()
* Tests for nodes/listeners.rs
* Add a few tests to help illustrate the "drowning" behaviour of busy listeners
* Tests for HandledNode
* Address grumbles
* Remove non-project specific stuff
* Address grumbles
* Prefer freestanding function
* Untangle the code for old shutdown test from the new tests
Add HandlerState and use it in TestBuilder
Shorter test names
* WIP – tests pass
* Use a newtype to lighten up the function signatures a bit
Test NotReady case
* Cleanup Event enum
Track events as they reach the Handler
Describe complex test logic
* Assert on the event trace
* More tests for poll()
* Switch to using usize as the OutboundOpenInfo so we can assert on event contents
More tests for poll()
* whitespace
* whitespace and spelling
* WIP tests for handled_node_tasks:Task
* wip
* Move Handler related code to dummy_handler
* Sort out the events going to/from node
* WIP tests for poll
* Add a TestBuilder for NodeTask tests
More NodeTask tests
* Fixes broken test after upstream changes
* Clarify the behaviour of is_shutting_down
* Fix broken test
* Test for task exit when muxers in- and outbound are closed
* Add question about impossible Async::NotReady
* Fix tests after recent changes on master
* Upstream changes
* Tests for HandledNodesTasks
* Add test for HandledNodesTasks poll
* Test we reach all nodes and then closed all nodes
* Test event emission by HandledNodesTasks
* Test starting CollectionStream
* Test that we can reach a peer after a successful connection
* Assert collection contains what we expect
* Test handler events get to the collectionstream
* Remaining tests for CollectionStream
* Run tests on single threaded runtime to avoid intermittent failures
* Remove call to shutdown – not needed
* No need to specify tokio version
* Rustfmt
* More rustfmt
* Less noise
* cleanup
* Address grumbles
* Better debug impl for HandledNodesTasks
* Remove tests for Task we don't need
Test Task.send_event() and id() using a HandledNodesTasks
* Rename test builders
* Don't organise tests in submodules
* whitespace
* Revert changes to Debug impl for HandledNodesTasks
* Cleanup
* cleanup
* Address concerns
* Fix tests
* Add unit tests for core::nodes::NodeStream
* Move DummyMuxer to core/tests
* Address grumbles
* Impl Debug for SubstreamRef<P>
* Add test for poll()
* Don't need to open a substream
* pretty printer test
* More tests for NodeStream poll()
* ListenerStream unit tests: transport() and listeners()
* Tests for nodes/listeners.rs
* Add a few tests to help illustrate the "drowning" behaviour of busy listeners
* Tests for HandledNode
* Address grumbles
* Remove non-project specific stuff
* Address grumbles
* Prefer freestanding function
* Untangle the code for old shutdown test from the new tests
Add HandlerState and use it in TestBuilder
Shorter test names
* WIP – tests pass
* Use a newtype to lighten up the function signatures a bit
Test NotReady case
* Cleanup Event enum
Track events as they reach the Handler
Describe complex test logic
* Assert on the event trace
* More tests for poll()
* Switch to using usize as the OutboundOpenInfo so we can assert on event contents
More tests for poll()
* whitespace
* whitespace and spelling
* WIP tests for handled_node_tasks:Task
* wip
* Move Handler related code to dummy_handler
* Sort out the events going to/from node
* WIP tests for poll
* Add a TestBuilder for NodeTask tests
More NodeTask tests
* Fixes broken test after upstream changes
* Clarify the behaviour of is_shutting_down
* Fix broken test
* Test for task exit when muxers in- and outbound are closed
* Add question about impossible Async::NotReady
* Fix tests after recent changes on master
* Upstream changes
* Tests for HandledNodesTasks
* Add test for HandledNodesTasks poll
* Test we reach all nodes and then closed all nodes
* Test event emission by HandledNodesTasks
* Rustfmt
* More rustfmt
* Less noise
* cleanup
* Address grumbles
* Better debug impl for HandledNodesTasks
* Remove tests for Task we don't need
Test Task.send_event() and id() using a HandledNodesTasks
* Rename test builders
* Don't organise tests in submodules
* whitespace
* Revert changes to Debug impl for HandledNodesTasks
* Add ProtocolsHandlerSelect
* Add a custom derive for NetworkBehaviour
* Remove 2018 edition
* More work
* Update the tests and work
* Allow ignored fields
* More fixes
* Give access to everything in the poll method
* Add ProtocolsHandler trait
* Reexport symbols
* Add a note about shutting down
* Add a PeriodicPingHandler and a PingListenHandler
* Fix core doctest
* Add tolerating not supported
* Fix concerns
* Add unit tests for core::nodes::NodeStream
* Move DummyMuxer to core/tests
* Address grumbles
* Impl Debug for SubstreamRef<P>
* Add test for poll()
* Don't need to open a substream
* pretty printer test
* More tests for NodeStream poll()
* ListenerStream unit tests: transport() and listeners()
* Tests for nodes/listeners.rs
* Add a few tests to help illustrate the "drowning" behaviour of busy listeners
* Tests for HandledNode
* Address grumbles
* Remove non-project specific stuff
* Address grumbles
* Prefer freestanding function
* Untangle the code for old shutdown test from the new tests
Add HandlerState and use it in TestBuilder
Shorter test names
* WIP – tests pass
* Use a newtype to lighten up the function signatures a bit
Test NotReady case
* Cleanup Event enum
Track events as they reach the Handler
Describe complex test logic
* Assert on the event trace
* More tests for poll()
* Switch to using usize as the OutboundOpenInfo so we can assert on event contents
More tests for poll()
* whitespace
* Move Handler related code to dummy_handler
* Fixes broken test after upstream changes
* Clarify the behaviour of is_shutting_down
* Fix broken test
* Fix tests after recent changes on master
* no tabs
* whitespace
* rustfmt
* Add public HandledNode.handler() method that returns a ref to the NodeHandler
Don't use private members in tests
* Add HandledNode.handler_mut that returns a mutable ref to the NodeHandler
* Remove debugging stmts
* Fix parse error
* remove tokio_current_thread tests
* Review changes:
Removed newline
Moved uds tokio test crate to top to avoid self and keep with convention of other test crates
Removed sleep from uds test and block until all futures are completed.
Add shutdown functionality to `NodeStream`.
Add `NodeStream::shutdown` to allow triggering the shutdown process,
and `NodeStream::poll_shutdown` as the internal way to drive any
potential shutdown to completion.
Update the `StreamMuxer` trait.
- `read_substream`, `write_substream` and `flush_substream` now return `Poll` instead of `Result`.
- A new `Shutdown` enum allows for half-closing of substreams and is used in `shutdown_substream`.
- `close_inbound` and `close_outbound` have been merged into `shutdown` which takes a `Shutdown` parameter to allow closing only one direction.
- Add a new `flush_all` method to allow flushing after a series of actions (e.g. multiple `shutdown_substream`).
W.r.t. flushing the general idea is that normal use drains buffers over time. Shutting down a substream does not imply flushing, so can be followed by `flush_substream` or (if multiple substreams are to be shut down) a single `flush_all`. Shutting down the muxer itself proceeds likewise, i.e. `shutdown` followed by `flush_all`.