Commit Graph

30 Commits

Author SHA1 Message Date
WindSoilder
5da61651ba remove useless comment 2020-05-06 17:23:17 +08:00
WindSoilder
41b28f466f make code compile, and fix typo 2020-05-06 09:11:03 +08:00
Carl Fredrik Samson
786faf4fd9 Removed the explicit call to close and mentioned a bug that can occur
when two tasks is given the same id.

The explicit close call is not needed. We can do that in the `Drop`
implementation instead. It's better to have accounting tasks like this
only one place and it didn't add anything to the example.

There is a subtle bug which occurs if two tasks are given the same Id.
I mentioned this explicitly since it's such an easy thing to do. I
added the fix as a reader excercise since for the examples sake I think
it's better to pass them in explicitly so that we don't "pollute" the
example with more code than strictly needed to get an understanding of
futures.
2020-04-27 00:02:41 +02:00
Stanislav Tkach
66d706b9e5 Fix minor typo (som -> some) 2020-04-17 17:44:07 +03:00
Carl Fredrik Samson
2fc79a9e03 added playground links to show problem using thread park/unpark 2020-04-14 00:37:03 +02:00
Carl Fredrik Samson
08b155698c Merge branch 'master' of https://github.com/cfsamson/books-futures-explained 2020-04-13 14:21:00 +02:00
Carl Fredrik Samson
d9eb756ef7 Added Bonus Section implementing a proper Parker
The problems addressed in the earlier version led to an "incorrect"
example which is bad to pass along after reading a whole book. after
getting some feedback in #2 i decided to show how we can create a
proper `Parker`.

The main example (which I assume most interested readers will copy) now
uses a proper parking thechnique so there should be no more dataraces
left.

I also removed the "Reader Excercise" paragraph suggesting that they
explore a way to implement proper parking since we now show that in
our main example.
2020-04-13 14:16:32 +02:00
eupn
3757194684 6_future_example.md: fix typo 2020-04-12 01:52:17 +08:00
Carl Fredrik Samson
73363e0583 Merge branch 'master' into typo-future 2020-04-11 00:27:21 +02:00
Carl Fredrik Samson
02bb33c6b6 minor fixes to the debug printout of the main example 2020-04-11 00:23:39 +02:00
marin
9744403a6b fix typo in code example 2020-04-10 23:46:59 +02:00
Carl Fredrik Samson
8934c46679 fixed imports in futures example 2020-04-10 21:10:48 +02:00
Carl Fredrik Samson
dbf8395bc0 merged with latest changes and made some additional corrections 2020-04-10 20:39:35 +02:00
Carl Fredrik Samson
32bedb934c several improvements, see #2 for more details 2020-04-10 20:26:41 +02:00
Carl Fredrik Samson
a90ff78349 some minor formatting updates 2020-04-09 00:43:25 +02:00
olehmisar
8dfc2f8ed3 Put plural endings after grave accents 2020-04-08 13:53:35 +03:00
cfsamson
f99523aaf5 final audit pass with minor changes 2020-04-07 11:13:17 +02:00
Carl Fredrik Samson
578c22ce01 final audit pass futures_example 2020-04-06 20:55:41 +02:00
cfsamson
0e57808ac6 audit pass conclusion 2020-04-06 17:01:34 +02:00
Carl Fredrik Samson
15d7c726f8 finished book!!!!!! 2020-04-06 01:51:18 +02:00
cfsamson
4c51fba01a some minor changes 2020-02-05 16:45:03 +01:00
cfsamson
6dd174c9e1 changed example 2020-02-05 10:11:21 +01:00
Carl Fredrik Samson
1ea3056b5c fixed tests 2020-02-04 01:32:41 +01:00
Carl Fredrik Samson
4af2fc03e6 added spawn chapter to main example 2020-02-04 01:31:02 +01:00
Carl Fredrik Samson
48e7150276 changed the order of timeouts to prevent connection timeout to playpen 2020-02-01 19:22:32 +01:00
Carl Fredrik Samson
b81c50a8f3 renamed event simple 2020-02-01 17:45:38 +01:00
Carl Fredrik Samson
92680313ea finished book 2020-02-01 17:23:49 +01:00
Carl Fredrik Samson
b509e4d32b made tests pass 2020-02-01 16:43:25 +01:00
Carl Fredrik Samson
917fa3c455 finished book 2020-02-01 16:35:11 +01:00
Carl Fredrik Samson
a28a7bee24 added last chapter 2020-02-01 02:59:50 +01:00