adding web sockets (part 1) #15
No reviewers
Labels
No labels
area: devops
area: discovery
area: docs
area: livestream
area: proposal
consider soon
dependencies
Epic
good first issue
hacktoberfest
help wanted
icebox
level: 1
level: 2
level: 3
level: 4
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
on hold
Osprey
priority: blocker
priority: high
priority: low
priority: medium
protocol dependent
resilience
Tom's Wishlist
type: bug
type: discussion
type: error handling
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/spee.ch#15
Loading…
Reference in a new issue
No description provided.
Delete branch "master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I added websockets implementation (using socket.io) to cover the retrieval of claims at spee.ch/name and spee.ch/name/claim_id
still needed: web sockets implementation for the publish functionality
@ -40,0 +46,4 @@
).then(function (getUriResponse) {
console.log(">> 'get claim' success...");
//check to make sure the daemon didn't just time out
if (getUriResponse.data.result.error === "Timeout"){
It's a good idea to define strings that have special values as constants.
Just a few late comments on this, I hadn't looked at it in detail until today.
@ -40,0 +55,4 @@
/*
note: put in a check to make sure we do not resolve until the download is actually complete
*/
resolve(getUriResponse.data.result.download_path);
If you find yourself accessing the same field repeatedly, like getUriResponse.data, it can be good to just dereference it.
Additionally, assuming you're writing ES6 (which is probably a good idea), you can just write:
.then(({data}) => { if (data.result.error === "Timeout") //etc. })
@ -109,0 +132,4 @@
.catch(function(error){
console.log(">> error:", error);
// reject the promise with an approriate message
reject(error.response.data.error);
This should probably be defined as a constant.