@@ -13,30 +13,30 @@ single [`run()`](#run) call that is controlled by the user.
1313
1414* [ Quickstart example] ( #quickstart-example )
1515* [ Usage] ( #usage )
16- * [ Loop] ( #loop )
17- * [ get()] ( #get )
18- * [ Factory] ( #factory )
19- * [ create()] ( #create )
20- * [ Loop implementations] ( #loop-implementations )
21- * [ StreamSelectLoop] ( #streamselectloop )
22- * [ ExtEventLoop] ( #exteventloop )
23- * [ ExtLibeventLoop] ( #extlibeventloop )
24- * [ ExtLibevLoop] ( #extlibevloop )
25- * [ ExtEvLoop] ( #extevloop )
26- * [ ExtUvLoop] ( #extuvloop )
27- * [ LoopInterface] ( #loopinterface )
28- * [ run()] ( #run )
29- * [ stop()] ( #stop )
30- * [ addTimer()] ( #addtimer )
31- * [ addPeriodicTimer()] ( #addperiodictimer )
32- * [ cancelTimer()] ( #canceltimer )
33- * [ futureTick()] ( #futuretick )
34- * [ addSignal()] ( #addsignal )
35- * [ removeSignal()] ( #removesignal )
36- * [ addReadStream()] ( #addreadstream )
37- * [ addWriteStream()] ( #addwritestream )
38- * [ removeReadStream()] ( #removereadstream )
39- * [ removeWriteStream()] ( #removewritestream )
16+ * [ Loop] ( #loop )
17+ * [ get()] ( #get )
18+ * [ ~~ Factory~~ ] ( #factory )
19+ * [ ~~ create()~~ ] ( #create )
20+ * [ Loop implementations] ( #loop-implementations )
21+ * [ StreamSelectLoop] ( #streamselectloop )
22+ * [ ExtEventLoop] ( #exteventloop )
23+ * [ ExtLibeventLoop] ( #extlibeventloop )
24+ * [ ExtLibevLoop] ( #extlibevloop )
25+ * [ ExtEvLoop] ( #extevloop )
26+ * [ ExtUvLoop] ( #extuvloop )
27+ * [ LoopInterface] ( #loopinterface )
28+ * [ run()] ( #run )
29+ * [ stop()] ( #stop )
30+ * [ addTimer()] ( #addtimer )
31+ * [ addPeriodicTimer()] ( #addperiodictimer )
32+ * [ cancelTimer()] ( #canceltimer )
33+ * [ futureTick()] ( #futuretick )
34+ * [ addSignal()] ( #addsignal )
35+ * [ removeSignal()] ( #removesignal )
36+ * [ addReadStream()] ( #addreadstream )
37+ * [ addWriteStream()] ( #addwritestream )
38+ * [ removeReadStream()] ( #removereadstream )
39+ * [ removeWriteStream()] ( #removewritestream )
4040* [ Install] ( #install )
4141* [ Tests] ( #tests )
4242* [ License] ( #license )
@@ -84,7 +84,7 @@ and run at the end of the program.
8484
8585``` php
8686// [1]
87- $loop = React\EventLoop\Factory::create();
87+ $loop = React\EventLoop\Loop::get(); // or deprecated React\EventLoop\ Factory::create();
8888
8989// [2]
9090$loop->addPeriodicTimer(1, function () {
@@ -100,9 +100,10 @@ $stream = new React\Stream\ReadableResourceStream(
100100$loop->run();
101101```
102102
103- 1 . The loop instance is created at the beginning of the program. A convenience
104- factory [ ` React\EventLoop\Factory::create() ` ] ( #create ) is provided by this library which
105- picks the best available [ loop implementation] ( #loop-implementations ) .
103+ 1 . The loop instance is created at the beginning of the program. This is
104+ implicitly done the first time you call the [ ` Loop ` class] ( #loop ) or
105+ explicitly when using the deprecated [ ` Factory::create() method ` ] ( #create )
106+ (or manually instantiating any of the [ loop implementations] ( #loop-implementations ) ).
1061072 . The loop instance is used directly or passed to library and application code.
107108 In this example, a periodic timer is registered with the event loop which
108109 simply outputs ` Tick ` every second and a
@@ -134,18 +135,26 @@ Loop::get()->addTimer(0.01, function () {
134135Loop::get()->run();
135136```
136137
137- ### Factory
138+ ### ~~ Factory~~
139+
140+ > Deprecated since v1.2.0, see [ ` Loop ` class] ( #loop ) instead.
138141
139- The ` Factory ` class exists as a convenient way to pick the best available
142+ The deprecated ` Factory ` class exists as a convenient way to pick the best available
140143[ event loop implementation] ( #loop-implementations ) .
141144
142- #### create()
145+ #### ~~ create()~~
143146
144- The ` create(): LoopInterface ` method can be used to create a new event loop
145- instance:
147+ > Deprecated since v1.2.0, see [ ` Loop::get() ` ] ( #get ) instead.
148+
149+ The deprecated ` create(): LoopInterface ` method can be used to
150+ create a new event loop instance:
146151
147152``` php
153+ // deprecated
148154$loop = React\EventLoop\Factory::create();
155+
156+ // new
157+ $loop = React\EventLoop\Loop::get();
149158```
150159
151160This method always returns an instance implementing [ ` LoopInterface ` ] ( #loopinterface ) ,
0 commit comments