« first day (2272 days earlier)      last day (2902 days later) » 

16:00
@Trowski Ok, I think I got it.
@tereško :-) .. yes, actually I'm the expert one in git at work. That's why I'm trying to work with it in practice
I thought you were hired as "junior developer"
@kelunik Also, a Listener forces backpressure. You should not assume consumers may necessarily want backpressure.
@kelunik yes, but that doesn't mean you should.
@tereško take that back :@ ..! I almost know PHP the same as you .. if I have just 4k, that's because of my poor English !!
@Shafizadeh heh, don't feel offended
16:06
@bwoebi :-) I don't .. just wanted to make him clear ;-)
@bwoebi Depends on the use case I guess.
well, you are in university - it is a reasonable assumption that a student will get hired as a junior dev
unless you are getting a Master's degree now
@tereško that's it ...!
@kelunik Yes, you should not assume the use case of the consumer within your API.
16:08
That's why you should return a Stream @kelunik
@Shafizadeh well ... I also have 12 years of work experience :D
@bwoebi I can't return a Stream in a coroutine.
@tereško that's why I said "almost" ;-)
neo
neo
@tereško @Shafizadeh you peoples are no good programmers as me :D
16:10
@kelunik And you shouldn't try to either.
You ought returning the Stream immediately, not at the end of some operation
You may not push data immediately, but the Stream should be returned immediately
A stream is just a placeholder, like Promise, just with optional updates
@Shafizadeh it's spelt Engrish
@Shafizadeh are you drunk ?
junior and 12 years experience are very very far apart ... like you can fit whole planets in the gap between them ... they are that far apart ...
@JoeWatkins There are people with 12 years experience who are just as ignorant as fresh juniors…
user895378
Often 12 years in one place equals one year of experience twelve times over.
@JoeWatkins I've used asciinema.org before, seems similar.
16:15
@rdlowrey Good morning
user895378
o/
34 mins ago, by Trowski
ObservableStream, EmitterProducer, PostponedEmitter, ObserverListener, Observable::subscribe()Stream::listen(), Postponed::observe()Emitter::stream()
that's true ... but in general, they're not the same thing for anyone you would want to work with ... plus we know @tereško is no junior ...
@rdlowrey ^ do you like these renames? (within amp v2) see branch: github.com/amphp/amp/tree/rename-observable
user895378
16:16
@bwoebi I do. A lot.
neo
neo
can you guys help me with reading this code ?
@rdlowrey You really should take a little time to review amp_v2
@rdlowrey I had that type of senior dev in one of the companies I worked for
do you all know of any code in PHP that wlil help wake me back up?
@rdlowrey @bwoebi @Trowski FYI: I added our domain and a bio to twitter.com/asyncphp
neo
neo
16:17
what does that last line of code means ?
$response = $datastore->projects->runQuery('YOUR_DATASET_ID', $request);
user895378
@bwoebi i know :(
@rdlowrey but the beach is more beautiful? :-)
Anonymous
1 message moved to Trash
Anonymous
@neo Use pastebin
neo
neo
@JayIsTooCommon kk
16:20
@JoeWatkins Now, I need a tool for actual shared console access … where two people access the same tty
@kelunik I'll have to work on promoting that more. Was planning on it once we were closer to releasing v2.
@bwoebi yeah that would be cool
@bwoebi I guess you got the mail for monotonic time now?
tbh it would probably just lead to me having to do even more work ...
@Trowski I think we four all agreed on the rename… so feel free to merge
@kelunik yep - just check externals… if they do, I most probably got it too
16:25
I was at my desk earlier and stood up to get a cup of tea, and my trousers fell down, I didn't have time to button them up last time I sat back down ...
@bwoebi Done. I also swapped the production and dev definitions of Deferred and Emitter.
@Trowski great :-)
@bwoebi I know. I just didn't see a response from you. :P
@Trowski Could you add docblocks in those files explaining what we do there?
Anonymous
@JoeWatkins remote life
@kelunik Oh, should I have?
16:28
@JayIsTooCommon yeah that ...
@kelunik I added doc blocks to the class definitions. Is that what you're looking for?
@bwoebi You wanted to discuss it on externals. Or did you just want to know if noone opposes?
Or do you mean something describing the reason for the craziness.
@kelunik The latter, and Anatol told you too to put it there
@Trowski No, something in the file that explains: What the fuck is this.
@bwoebi Anatol also called event loops based on stream select edge cases.
16:29
@kelunik They quite are, compared to what most things written in PHP do.
@bwoebi I mean compared to extension based loops.
@kelunik well, then no.
But it really applies to everything measuring time.
> What you link is a compatibility shim. It's unlikely one would want to run a pure PHP implementation in production, and for development it doesn't matter much. Nevertheless, some monotonic timer implementation in the core could be pursued. To workout the best course of action the topic should be to discussed on internals.
@JoeWatkins Less if you ignore failed tests: github.com/php/php-src/…
16:34
@kelunik This is a hurtle we need to climb with Amp. I think we need comparisons to Node and some performance metrics right out front if it's going to be taken seriously.
yeah but travis fails for no good reason/unrelated reasons a lot of the time
@JoeWatkins <3 your new year's resolution ;)
@JoeWatkins I know :-(
@Trowski We need to finish interop, release v2, build really solid docs, make people write apps / go to conferences.
also, t-shirts ...
@kelunik Yes, all that too. :-)
you forgot
@Trowski So why does Producer accept a callable, but Coroutine does not? That feels inconsistent somehow. But Producer needs it to pass the emit callable, I know.
I just wanted to call ProducerEmittingCoroutine or StreamCoroutine or something like that.
Morning.
@JoeWatkins :-P
moin levi
16:45
@Trowski Did you fix Internal\Producer to allow emits when it's resolved with a promise until the promise resolves?
@kelunik No, I wasn't sure which behavior we wanted. /cc @bwoebi
@kelunik Why would you want to introduce that bug?
@bwoebi If you resolve with a promise, the stream isn't actually resolved yet.
@kelunik The stream isn't, but the Emitter is.
@bwoebi Stream === emitter?
16:52
The stream is the publicly observable state, the emitter the private state
@kelunik Once you've called $emitter->resolve(), it would seem like a bug to me to call $emitter->emit() again.
when you resolve with a Promise, the private state gets set to resolved… but the public state gets bound to the state of the Promise.
@Trowski precisely.
Imagine the following example:
$stream = ...
$newStream = new Emitter;
$stream->listen(function ($val) use ($newStream) { $newStream->emit($val); });
$newStream->resolve($stream);
return $newStream;
@Trowski The emitter isn't resolved when you can resolve with a promise, that's the thing.
I am fine with piping Stream values when a Stream is resolved with another stream.
@bwoebi That might have unexpected consequences.
16:57
@kelunik Also note that $stream->when(function ($e, $v) use ($newStream) { $newStream->resolve($e ? new Failure($e) : $v); }); is easy too.
@kelunik that's true…
so better don't.
@bwoebi In that case we can just remove the support for calling resolve with a promise?
(obviously kidding)
@kelunik Note that you are describing an edge case…
@bwoebi Note that you want to make it an edge case by keeping buggy behavior.
@kelunik I disagree it's buggy
It'd be a bug to me to allow emit() after resolve()
@bwoebi Not exactly… if I could resolve a stream with a promise before all values were emitted, most of the functions working on streams in Amp would be much simpler.
16:59
Whether the promise is already resolved or not doesn't matter
@bwoebi What's the error message after calling emit then?
So I definitely see where @kelunik is coming from on this.
@Trowski hmm, example?
@bwoebi This could just be $emitter->resolve(all($streams));
Yeah, concatenating streams is the single use case
But concatenating streams is AFAIK an edge case?
17:02
3 mins ago, by kelunik
@bwoebi What's the error message after calling emit then?
@bwoebi This would be just $emitter->resolve($stream);
But yeah, it's not going to happen a lot.
Or we have functions for it, like each().
@kelunik the function should be defined in Internal\Producer
@Trowski no it wouldn't (because your catch (Throwable) and failing the emitter then - double resolution would be bad)
17:06
@bwoebi Right, good call.
@Trowski It is quite limiting … after you resolve with a Promise you cannot react to future events anymore and eventually fail it earlier or such
Allowing emit after resolve probably just opens the door to more accidental double resolves
@kelunik I'm thinking your example really is an edge case mostly covered by functions like each(), filter(), and merge().
hey... do yall know why you never see cows hiding in trees?
@bwoebi I agree. That was my first thought, and this conversation solidified that.
@rabbitguy yeah, they hide well ;o) // old joke^^
17:10
don't give away the punchline!
old joke, but still funny
The best way to communicate between a websocket process and a Web request is probably going to be some sort of queue, right?
The request script pushes the event to the queue, it's picked up and pushed out by the ws process
@Sean yep
especially as there may be multiple ws processes (if you ever scale out)
Ooh, gonna have fun dabbling with that :D thanks
@Sean (so you need a distributed queue which every process needs to read from [and not: one process removes it completely from the queue]… basically something comparable to redis pubsub)
17:21
Anybody familiar with XMPP? not calling the offline callback URL from plugin
@JoeWatkins We are currently using a deprecated API and the proposal is to use a different deprecated API. Is there anything not deprecated we could use? Sheesh.
@LeviMorrison Are we currently?
At least according to the comments in the PR, yes.
@LeviMorrison As far as I see RtlGenRandom is deprecated
I don't see the one we are using marked deprecated though
how am I supposed to know if it's not stated in msdn ... that's all we have to go on ...
the one he wanted to use come with a warning that it may be removed (which is what I assume he meant by deprecated) ... no such warning in currently used function ...
17:28
@JoeWatkins Well BCryptGenRandom is marked as "new gen API" … so perhaps CryptGenRandom will be deprecated some day… but meh
I super hate windows ...
@JoeWatkins Good that we can defer these things to Anatol :-)
gah
hi! coders
please please. we prefer to be called "sir"
17:36
@NikiC meh and gah ...
@JoeWatkins moooo
we have a 6 years work about yii now we want to switch laravel, So how it will be for large scale applications
@NikiC lol
watchout everyone... if you have a good joke, @bwoebi will give away the punchline
@Trowski A stream is a promise. The promise is by definition of the spec not resolved after calling resolve with an unresolved promise. @bwoebi
17:39
@MdAbdulMomin we don't do Laravel, and we morally object to Yii
Anyone can suggest me!
@kelunik Yeah, it's just wording
should be more like "the emitter has been resolved"
@bwoebi The wording is right. The behavior is not.
@kelunik Disagree as said.
Thanks @JoeWatkins
17:44
I hope you realise that nobody can answer your question ... even if you got the king of laravel and the queen of yii together in a room, they couldn't give you a good answer ...
so I have a list of 50,000 or so items that I have to run a query on each individual item in that list. I currently use 80 threads at a time to poll the server, but when that thread dies after its one search, I spin up a new thread to do the next search. How much slower am I making it by doing that instead of just keeping 80 threads active and have each of them to search over and over again until the list is exhausted?
what do you mean by thread ?
a process... this is a general CS question... not PHP directly
o/
17:48
@bwoebi It doesn't make any sense to me to differentiate between X resolved and X resolved when they're really the same thing.
@kelunik because they aren't.
using processes to multiplex i/o is quite horrible usually, using 80 processes to do anything is also horrible usually
there's no general answer whatever, it all depends what kind of IPC you are using, what the processes are actually doing (polling server doesn't tell us much, presumably they are doing something else also) ....
@bwoebi Then tell me what makes them different.
They're the same object.
If you argue they're different, then either resolve does two things at once or it's a bug.
@kelunik That's just an optimization we apply in prod
@kelunik well, resolve does actually do two things at once… it contains code for delaying the resolution of the promise until resolution of the passed promise and code for immediate resolution of it
@bwoebi No, the optimization is combining production and consumption of values, not combining stream and promise.
18:02
@kelunik yes, that's what we're talking about?
@bwoebi No?
I'm talking the whole time about emit and resolve, which are both the production part.
An Emitter can only emit as long as the Emitter hasn't been resolved yet. An Emitter can only be resolved as long as it hasn't been resolved yet.
They share their semantics
@bwoebi Same with a promise. That's correct so far.
But the emitter isn't resolved by definition of a promise when resolve is called with a non-resolved promise.
@kelunik well, it is.
@bwoebi It is not. We set a flag that's called resolved, but we only do that to prevent double-resolution.
18:06
You cannot resolve the Emitter once more once you've resolved it, no matter whether by any value or an unresolved value
@kelunik No, that resolved flag is representing inherent semantics of Deferred and Emitter
> A Promise is resolved once it either succeeded or failed. – github.com/async-interop/promise#states
A Promise (done @NikiC)
pls add italics
And Stream extends Promise and is therefore a promise.
@kelunik yes, I agree
I'm only talking about the objects issuing the stream/promise
18:08
@bwoebi And it doesn't make any sense to have two kinds of resolved in Stream.
@kelunik Well, that's my whole point - it does. (in Emitter, not Stream)
@kelunik And you do in Deferred too - its effect is preventing double resolution.
@bwoebi It's not a side-effect. It's the sole point of the flag.
@kelunik yeah, meant effect, not side-effect
@bwoebi Every stream, same in Producer.
@kelunik It just happens that Producer is an instance of Stream - internally (the callback handling) it has the same behavior as Emitter and Deferred
18:12
@bwoebi Deferred doesn't resolve on resolve either if a non-resolved Promise is passed.
@kelunik It does… Just the Promise issued isn't necessarily immediately resolved.
Let's go another way... what's the advantage of preventing emits there?
1 hour ago, by bwoebi
@Trowski It is quite limiting … after you resolve with a Promise you cannot react to future events anymore and eventually fail it earlier or such
1 hour ago, by bwoebi
Allowing emit after resolve probably just opens the door to more accidental double resolves
@bwoebi How so? @Trowski
1 hour ago, by Trowski
@bwoebi This would be just $emitter->resolve($stream);
18:19
How is emit connected to resolve other than not allowing emissions after resolution?
1 hour ago, by bwoebi
@Trowski no it wouldn't (because your catch (Throwable) and failing the emitter then - double resolution would be bad)
It's an easy pitfall here
I wish PHP had hygienic macros or method inlining.
@LeviMorrison what do you mean with hygienic macros?
@bwoebi That one could be solved by ignoring additional fail calls if the promise failed. @Trowski
That would also eliminate the $pending logic then.
@kelunik so, that'd be essentially allowing double resolution?
18:24
@bwoebi No, it'd take the first one and just ignore the later one.
wat … no way.
user895378
I don't think you should ever ignore additional fail calls ...
user895378
it's an error in the code
@bwoebi They understand the syntax of the language and will not accidentally capture/clobber identifiers. C macros are not hygienic; they are text replacement. Rust and Julia are languages that have hygienic macros.
user895378
I would want to be notified that I did something wrong in my code ...
18:26
@rdlowrey exactly
@LeviMorrison Ah, well, I missed macros some times too in PHP, but I don't feel too well unleashing them onto the world…
	public
	function choose(callable $f) {
		return $this->build('Ardent\Algorithm\choose', $f, $this->getIterator());
	}

	public
	function flatten() {
		return $this->build('Ardent\Algorithm\flatten', $this->getIterator());
	}

	private
	function build(callable $algorithm, ... $args) {
		$bldr = $this->newBuilder();
		foreach ($algorithm(... $args) as $key => $value) {
			$bldr->add($key, $value);
		}
		return $bldr->result();
	}
@rdlowrey If you double-fail a promise the resolution of the bug will almost always be a pending flag I guess.
^ It just annoys me how inefficient this is. If we had macros or method inlining then I could write it no worries.
@LeviMorrison method inlining it'd be…
Introducing callables and other things already has extra cost. I shouldn't have to pay a performance cost for every abstraction...
18:31
macros are just bandaid for inlining in that case @Levi
@kelunik I dunno… it's dangerous to make assumptions in that regard. Better play safe.
What are the current hold-ups for in-lining that exact method build? /cc @NikiC @bwoebi
@bwoebi In sync code, your method call also ends with the first thrown exception.
@LeviMorrison In the case the code is anyway local, not too much, except that it's not implemented
@kelunik yes, because only one is actually ever thrown. (unless you use dark try/finally magic … which, let's not loose a word about it.)
@kelunik You could just as well say "In sync code your method call also ends with the first returned value"
Yeah, that one wasn't a good argument...
evening all
18:46
@bwoebi Can we merge github.com/amphp/dns/pull/40/files now and release a new version? I removed the fallback changes for now.
@kelunik (grumble, grumble, yet another external dependency which isn't even always required)
@kelunik I've used your acme-client, awesome work done here :)
@bwoebi It's useful on it's own.
@brzuchal Thanks!
@kelunik I don't disagree, I'd prefer to see that dependency moved to the amphp organization though
At least as this dependency uses amp as dependency and is a dependency for amphp projects
@bwoebi We can do that for Amp v2 then when @DaveRandom did the additions.
18:48
so if anything changes in Amp, I'd like to be able to update everything in amp synchronously
@LeviMorrison my inlining implementation should be able to handle that case
@NikiC Which branch? Current master?
i.e. I'd like to see all dependencies in Amp projects which themselves depend on Amp to be under the amphp mantle
@kelunik We can do it now too.
I don't really care, can do that, too.
yes, please do.
When you've done that, feel free to merge (ideally squash)
18:51
evenin kids
@tereško afternoon
@LeviMorrison yes
@NikiC Will this work on the CLI as long as opcache is enabled??
@LeviMorrison yeah
18:58
Sweet. Going to take it out for a test-drive.
@kelunik Thanks :-)
@JayIsTooCommon Pongwo
@bwoebi A bit too fast...
@kelunik why? It was fine, all what needed change is the names, which you've done?
chat.stackoverflow.com/transcript/11?m=34912283#34912283 @NikiC Are there any issues to that, or does it mainly just need someone to actually implement it?
@bwoebi Because AppVeyor setup...
@bwoebi I'd say the latter
See latest commit on that branch.
19:17
@NikiC Okay good… I'm looking forward to the gigantic merge conflict with all branches proposing improvements to optimizer…
@kelunik oh, well… just cherry-pick that for master then
function foo(): ["bar" => int, "qux" => float]
I just realised that this 1) naturally follows function foo(): [int, float], and 2) could be the same implementation
hmm
@WyriHaximus I copied your config, but ci.appveyor.com/project/kelunik/dns doesn't work. No idea of AppVeyor, what's wrong?
@Jimbo Whatever happened to "ass-cactus"?
interesting nickname
@rabbitguy Sounds like a good use case for the Actor model.
19:33
@rabbitguy Generally speaking, a thread pool would perform better, under most circumstances.
PHP 7.0.8-3ubuntu3: 0.036s
PHP 7.2.0-dev: 0.014s
Too many variables there to make much of a meaningful conclusion other than it is faster on this file ^_^
brb writing a blogpost stating that 7.2 will be twice as fast
@tpunt @MadaraUchiha - the bottle neck for me is asking for and waiting for the data I need.
@NikiC Is there a way to obtain inlining information? To see if it happened or not?
@rabbitguy If IO is the bottleneck by a large margin, perhaps an event loop would suit you better?
19:41
Based purely off my timing information it seems to be applying but I want to try to check.
it's their server, tbh
A thread pool is really good for doing CPU intensive work parallelly
But having 80 threads sleep on IO is wasteful
@LeviMorrison -dopcache.opt_statistics=1
You aren't wasting resources, you're wasting potential
having 80 threads request data and then wait for the reply is the waste?
19:42
hey guys, anyone experienced with ubuntu and digital ocean? I'm a newbie and having trouble with activating sendmail() function. I just am not able to send mail with php's native mail() function.
@NikiC Where does that information get dumped?
@LeviMorrison stderr
once the thread gets the data and adds it to the list, it throws away the thread and spins up a new one
Hmm... doesn't seem to be applying then. But it's quite fast so hey! there's that ^_^
I have a MVC-like architecture that is using FastRoute. If I have a page that is able to submit (post) multiple actions, which of these options is worse? 1) Updating a hidden input named "SelectedAction" before submitting the form then have a switch statement in my controller. 2) Updating the form attribute "action" to a URL that will route to a specific controller and action. E.G action="/members/list" becomes action="/members/delete".
I understand that "worse" is subjective so I guess I'm really asking if anyone foresees any problems that I will run into with either method? Also updating hidden inputs or form attributes with JavaScript leaves a bad taste in my mouth. Is there a better solution that I have not thought of?
19:47
@LeviMorrison you mean you don't get any statistics printed?
@NikiC Yes - still poking around to make sure opcache was actually enabled, etc.
@rabbitguy If you could have done it on one thread, yes.
You need -dopcache.enable_cli=1 -dopcache.optimization_level=-1
If you're waiting on IO, you basically have 80 threads on standby for 90% of the time
(or more)
@MadaraUchiha if I didn't do the multiple threads and instead did one thread, I would wait hours for all this data... instead it's 5-10 minutes
19:48
Opening threads/processes has its own overhead
@rabbitguy Not necessarily
I started w/a one thread approach
If you use async IO, you'll be able to read concurrently, but not parallelly
@rabbitguy With what, PHP?
Java?
yes, java, but really (again) this is a purely cs question...
Ah... it's not finding opcache.
@rabbitguy Give it at try in Node
19:51
why not scala?
or brainf*ck?
Or in PHP with AMP
@rabbitguy Because NodeJS has async IO by default as part of the platform
I swear, though java is my main language, I do develop web apps in php, lol
It has native promises and coroutines and a bunch of other stuff that make concurrent IO really nice
okay...
i'll take a look at it
PHP's AMP (which is developed here in this room) also has most of those features, and some more
If you want to take a look in PHP because you feel you know it better, you can use that.
19:54
I do know it better than js, but I can learn any language, or at least my degree said that, lol
@NikiC Do I need to enable Optimizer somehow?
@MadaraUchiha java has an async io class... is that not going to do the same for me?
@rabbitguy It could
I was under the impression that async in Java was primarily a thread thing
Link?
I am just now reading over this... haven't gotten to the meat and potatoes of it yet
@LeviMorrison Yes, using opcache.optimization_level=-1 (not sure if that's on by default)
19:58
Hmm... I have that... will continue investigating...

« first day (2272 days earlier)      last day (2902 days later) »