1
0
mirror of https://github.com/danog/amp.git synced 2024-12-11 17:09:40 +01:00
Commit Graph

57 Commits

Author SHA1 Message Date
Aaron Piotrowski
cecbbd3f40
Drop sleep() and refactor delay to use await() 2020-10-06 23:40:14 -05:00
Aaron Piotrowski
72b50523a3
Add separate method to await back pressure 2020-09-25 12:32:37 -05:00
Aaron Piotrowski
8e4cc1bbd1
Refactor Pipeline for async/await 2020-09-24 22:14:58 -05:00
Aaron Piotrowski
5f6db028ab
Initial fiber support 2020-09-24 12:53:32 -05:00
Aaron Piotrowski
5e521daa16
Rename to Pipeline 2020-09-24 12:53:31 -05:00
Aaron Piotrowski
b64b3affc9
Rename yield() to emit() 2020-09-24 12:53:30 -05:00
Aaron Piotrowski
66f0deb563
Drop YieldedValue 2020-09-24 12:53:29 -05:00
Aaron Piotrowski
d496c9db24
Resolve promise with YieldedValue
A suggested alternative to resolving with [$yieldedValue] since static analysis (specifically Psalm) doesn't play well with that API.

Will revert if Psalm changes or we decide to resolve with [$yieldedValue] anyway.
2020-09-24 12:53:29 -05:00
Aaron Piotrowski
96007f11aa
Add Streams 2020-09-24 12:53:27 -05:00
Niklas Keller
1e58d53e4a Fix code style and run PsalmTest only on PHP 7.1+ 2020-04-30 06:54:50 +02:00
Niklas Keller
17e2c2344c Improve call / coroutine / wait types, add psalm test 2020-04-30 06:46:52 +02:00
Niklas Keller
3d250cbe30 Cover examples with psalm and add @psalm-yield to Promise 2020-04-04 15:49:26 +02:00
Aaron Piotrowski
a726db92a5 Only create deferred for backpressure if necessary 2019-09-21 18:30:14 +02:00
Markus Staab
4e822395c9 Fix typo (#268) 2019-04-18 18:41:34 +02:00
Niklas Keller
fa3fe1d20b Apply PSR-2 2018-06-18 20:00:01 +02:00
Niklas Keller
118ed983be Fix code style 2018-01-08 22:00:15 +01:00
Niklas Keller
46b1a27825 Add garbage collection example with iterators 2018-01-08 21:26:46 +01:00
Markus Staab
34bf671f13 Automatically add \ for buitins (#186)
Fixes #185.
2017-11-29 13:36:50 +01:00
umbri
abe92a78ad Add basic promise examples (#179) 2017-11-08 14:01:26 +01:00
Niklas Keller
19113ed5f1 Add example cross-ref to amphp/socket
amphp/amp is the base library, but people should be aware of the abstractions provided instead of directly using Loop::on* if possible.
2017-10-30 21:56:31 +01:00
Niklas Keller
361b6cefbb Fix code style 2017-09-20 17:50:00 +02:00
Niklas Keller
f2a662534e Improve exception examples 2017-09-20 17:34:20 +02:00
umbri
bb34b9fb2d Added exception examples 2017-09-20 17:26:07 +02:00
Niklas Keller
31f021e59a Add coroutine concurrency example 2017-06-04 16:12:46 +02:00
Niklas Keller
50b37b23ef Add asyncCall 2017-05-03 15:21:49 +02:00
Niklas Keller
3c0d4153c7 🚚 Rename basic examples directory to event-loop 2017-05-02 18:36:02 +02:00
Niklas Keller
1b1ea5688c Add signal and stdin examples 2017-05-02 13:32:58 +02:00
Niklas Keller
2a5600f027 Use asyncCoroutine instead of manual rethrow + new Coroutine 2017-05-02 13:11:52 +02:00
Niklas Keller
c29da96f3e Fix remaining Pause → Delayed in examples and docs 2017-05-02 07:25:22 +02:00
Aaron Piotrowski
da9b724f5b getIterator → iterate 2017-05-02 07:07:43 +02:00
Aaron Piotrowski
45481a710c Squash leftover Stream references 2017-05-02 07:07:33 +02:00
Aaron Piotrowski
0d2095e14d Rename examples directory 2017-05-02 07:07:20 +02:00
Aaron Piotrowski
38d53304ae Stream → Iterator 2017-05-02 07:07:20 +02:00
Aaron Piotrowski
4935dddc84 Refactor Streams
Dropped original Stream interface in favor of the Iterator interface. Eliminates subscriber timing issues and simplifies Stream usage.
2017-05-02 07:04:10 +02:00
Niklas Keller
1286087c06 Rename Pause to Delayed
Pause doesn't cover the delayed value use case.
2017-05-02 07:02:02 +02:00
Niklas Keller
79ab41e5bf Update php-cs-fixer to version 2 and upgrade rules
This also fixes the code style according to the new rules.
2017-04-24 16:22:02 +02:00
Niklas Keller
689502c0ee Apply code style rules also to examples 2017-04-24 15:27:04 +02:00
Niklas Keller
5e545301cd Rename Listener to StreamIterator 2017-04-13 18:20:46 +02:00
Niklas Keller
2aa91a6c25 Rename Stream::listen to Stream::onEmit 2017-03-21 18:29:51 +01:00
Niklas Keller
ce269fa516 Rename Promise::when to Promise::onResolve, resolves #77 2017-03-21 17:23:37 +01:00
Niklas Keller
0649fdc618 Add structure to examples, add basic timer example 2017-03-12 19:54:52 +01:00
Niklas Keller
9797e7a4d0 Rename example to examples 2017-03-12 19:47:08 +01:00
Daniel Lowrey
c3298f104a remove examples 2015-07-22 09:09:17 -04:00
Daniel Lowrey
ff893fa784 Update examples 2015-05-20 15:19:31 -04:00
Grégoire Pineau
01d50d10f9 Fixex typos 2015-02-05 18:17:05 +01:00
Douglas G.R
4092730b74 Asyncronously read from client and broadcast to others.
echo server example (run in terminal):
  - start the service
  php 007_broadcast_server.php

  - Connect to 127.0.0.1 at port 1337 from various terminals;
  nc 127.0.0.1 1337

  - Type in anything and press ENTER; Reactor will asyncronously read
    from client and broadcast to others.
2014-12-26 17:59:51 -02:00
Douglas G.R
badb741c81 Should use Amp\run directly instead of Amp\getReactor()->run.
- Amp\run implicitly creates the reactor.
2014-12-26 15:41:25 -02:00
Douglas G.R
4c791d5952 Fix all deprecated warnings in examples. 2014-12-26 15:29:51 -02:00
Daniel Lowrey
7064ec5dc8 Migrate repo to amphp/amp 2014-09-23 00:06:03 -04:00
Daniel Lowrey
3a5c673471 Add libuv signal handling example 2014-08-06 16:01:40 -04:00