Comments (5)
I'm struggling to understand how things work right now.
- When the sim runs, it ticks 1ms forward
Lines 152 to 161 in 2dd03ad
- When a message is received, it is only delivered based on whether wallclock now has advanced.
.. presumably this means that for fast tests (i.e. ticks are < 1ms) the code lands up waiting for realtime to advance?
on the recv path (https://github.com/tokio-rs/turmoil/blob/main/src/io.rs#L20) it looks like we will wait for a notification, which (I think) is triggered when the host ticks past the wallclock-now of the message delivery time (which is based on fake time on the send host - which also seems busted to me)
from turmoil.
which is based on fake time on the send host - which also seems busted to me
I take that back. Host::send
is actually called on the receiving host. So the method name is just confusing.
from turmoil.
There is some magic (through globals, my favorite) going on that makes this more or less work out the way it should. I'm not sure it's 100% yet, so I plan on digging more before closing this out. Hopefully I can add some comments to help explain how it all works.
from turmoil.
You can schedule some time with me and I can walk you through it. Short version is that it uses Tokioโs Instant::now which can be made virtual.
from turmoil.
See #23
from turmoil.
Related Issues (20)
- support ephemeral port assignments HOT 1
- Implement additional UDP features HOT 1
- Fix AsyncRead impl for TcpStream
- Regex matching throws exception in Pair
- Question: Reproduce, Random and Time HOT 4
- meets Tokio `enble_io()` error HOT 4
- Return errors instead of panicking, when sending invalid packets. HOT 2
- Support multiple network interfaces HOT 8
- Loopback is incomplete
- Error `ConnectionRefused` when binding UdpSocket to `localhost` HOT 2
- Spawn blocking blocking sim runtime HOT 1
- Infinitely running. HOT 2
- Fix socket close behavior when there is unread data
- Add support for SO_LINGER to `TcpStream`
- Add warning for blocking tasks that block the sim
- Support one-way partitions
- Enable testing of backpressure from TCP connections HOT 2
- Network partition should cause 'host unreachable' not 'connection refused' for TCP HOT 4
- Re-starting a crashed host with bounce panics
- More interesting examples of testing distribution system building blocks HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from turmoil.