Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(881)

Unified Diff: examples/indirect_service/README.md

Issue 733563002: Mojo Example that demos the difference between providing and requesting an interface (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fixed Android build Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « examples/indirect_service/BUILD.gn ('k') | examples/indirect_service/indirect_integer_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/indirect_service/README.md
diff --git a/examples/indirect_service/README.md b/examples/indirect_service/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..e26b391bdea6a4273032d89b3211fcd257c363f7
--- /dev/null
+++ b/examples/indirect_service/README.md
@@ -0,0 +1,27 @@
+Indirect Service Demo
+=====================
+
+This demo is intended to highlight the difference between requesting a service
+and providing one. The demo is based on two services: IntegerService and
+IndirectIntegerService.
+
+interface IntegerService {
+ Increment() => (int32 value);
+};
+
+This trival interface just manages a single internal integer that's initialized
+to 0. The Increment() method returns a new value.
+
+interface IndirectIntegerService {
+ Set(IntegerService? service);
+ Get(IntegerService&? service);
+};
+
+This service delegates to the one IntegerService provided by the Set() method.
+Clients use Get() to request a connection to an IntegerService that targets the
+delegate. This is roughly an IntegerService "pointer".
+
+The demo creates a set of threads all of which get their own connection to the
+shared IntegerService via the IndirectIntegerService. The threads all access
+the IntegerService at the same time and then display a little table of the
+results.
« no previous file with comments | « examples/indirect_service/BUILD.gn ('k') | examples/indirect_service/indirect_integer_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698