W3C home > Mailing lists > Public > public-secondscreen@w3.org > October 2015

Re: [presentation-api] PresentationReceiver: rename getConnection() and getConnections()

From: Mounir Lamouri via GitHub <sysbot+gh@w3.org>
Date: Wed, 07 Oct 2015 14:34:05 +0000
To: public-secondscreen@w3.org
Message-ID: <issue_comment.created-146212410-1444228444-sysbot+gh@w3.org>
Having ```receiver``` has a promise isn't that different from 
```connections``` as a promise and will make it more complex for a 
website to know if it is being run as a receiver (ie. checks if 
```navigator.presentation.receiver``` is ```null```.

If we follow Anton's lead and not distinguish first connections from 
the others but still want to keep the one connection UC easy, what 
about having something as simple as:
```idl
interface PresentationReceiver {
  Promise<PresentationConnection> waitForNextConnection();
};
```

It would basically behave like a stream and will resolve the promise 
when a ```PresentationConnection``` is available. It solves a couple 
of issues like having to deal with whether we should show closed 
connections in ```connections```. The website would have to take care 
of handling all the connections itself.
(Anton pointed to me that he suggested [something similar in the 
past](https://github.com/w3c/presentation-api/issues/19#issuecomment-109386548)
 so it must definitely be a great idea ;))

WDYT?

-- 
GitHub Notif of comment by mounirlamouri
See 
https://github.com/w3c/presentation-api/issues/201#issuecomment-146212410
Received on Wednesday, 7 October 2015 14:34:07 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 October 2015 14:34:07 UTC