René's URL Explorer Experiment


Title: RTS stop 3 by aquamoth · Pull Request #13 · jamesshore/lets_code_javascript · GitHub

Open Graph Title: RTS stop 3 by aquamoth · Pull Request #13 · jamesshore/lets_code_javascript

X Title: RTS stop 3 by aquamoth · Pull Request #13 · jamesshore/lets_code_javascript

Description: I suggest rewriting the cleanup logic to ask RealTimeServer to disconnect all open sockets before stopping the http server. This code is still somewhat a hack, because I don't quite understand why I need some setTimeout() wrappers around done, but I still think this is a lot better. Also the private variable RealTimeServer._disconnectAllCallback can be debated, but doing it like this we can keep numberOfActiveConnections() as a private method without explicit testing. This is my preferred PR of 3 to improve the shutdown logic.

Open Graph Description: I suggest rewriting the cleanup logic to ask RealTimeServer to disconnect all open sockets before stopping the http server. This code is still somewhat a hack, because I don't quite understand ...

X Description: I suggest rewriting the cleanup logic to ask RealTimeServer to disconnect all open sockets before stopping the http server. This code is still somewhat a hack, because I don't quite underst...

Opengraph URL: https://github.com/jamesshore/lets_code_javascript/pull/13

X: @github

direct link

Domain: patch-diff.githubusercontent.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:2fbeff78-1023-7aef-9f68-716b94964a2a
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC808:42376:144A32B:1A5E86F:69924A97
html-safe-nonce41875d45c10068fdf97e57f57e9b864b9d738c2f44c9b0f6d74780e8edf8572b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODA4OjQyMzc2OjE0NEEzMkI6MUE1RTg2Rjo2OTkyNEE5NyIsInZpc2l0b3JfaWQiOiI2ODU1MDY3OTQ3MDkxNzc0MTAzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac1dc2a0e4689c563738d7f0ac0c7e3904a4bc7108005f4a9bdc871bddb94ff402
hovercard-subject-tagpull_request:121655371
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/jamesshore/lets_code_javascript/pull/13/files
twitter:imagehttps://avatars.githubusercontent.com/u/5458487?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/5458487?s=400&v=4
og:image:altI suggest rewriting the cleanup logic to ask RealTimeServer to disconnect all open sockets before stopping the http server. This code is still somewhat a hack, because I don't quite understand ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/jamesshore/lets_code_javascript git https://github.com/jamesshore/lets_code_javascript.git
octolytics-dimension-user_id123129
octolytics-dimension-user_loginjamesshore
octolytics-dimension-repository_id4981757
octolytics-dimension-repository_nwojamesshore/lets_code_javascript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id4981757
octolytics-dimension-repository_network_root_nwojamesshore/lets_code_javascript
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release848bc6032dcc93a9a7301dcc3f379a72ba13b96e
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fjamesshore%2Flets_code_javascript%2Fpull%2F13%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fjamesshore%2Flets_code_javascript%2Fpull%2F13%2Ffiles
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=jamesshore%2Flets_code_javascript
Reloadhttps://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files
Reloadhttps://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files
Reloadhttps://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files
jamesshore https://patch-diff.githubusercontent.com/jamesshore
lets_code_javascripthttps://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fjamesshore%2Flets_code_javascript
Fork 128 https://patch-diff.githubusercontent.com/login?return_to=%2Fjamesshore%2Flets_code_javascript
Star 251 https://patch-diff.githubusercontent.com/login?return_to=%2Fjamesshore%2Flets_code_javascript
Code https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript
Issues 0 https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/issues
Pull requests 9 https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pulls
Actions https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/actions
Projects 0 https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/projects
Wiki https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/wiki
Security 0 https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/security
Insights https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pulse
Code https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript
Issues https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/issues
Pull requests https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pulls
Actions https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/actions
Projects https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/projects
Wiki https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/wiki
Security https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/security
Insights https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pulse
Sign up for GitHub https://patch-diff.githubusercontent.com/signup?return_to=%2Fjamesshore%2Flets_code_javascript%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://patch-diff.githubusercontent.com/login?return_to=%2Fjamesshore%2Flets_code_javascript%2Fissues%2Fnew%2Fchoose
aquamothhttps://patch-diff.githubusercontent.com/aquamoth
jamesshore:masterhttps://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/tree/master
aquamoth:RTS-stop-3https://patch-diff.githubusercontent.com/aquamoth/lets_code_javascript/tree/RTS-stop-3
Conversation 0 https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13
Commits 1 https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/commits
Checks 0 https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/checks
Files changed https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files
Please reload this pagehttps://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files
RTS stop 3 https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files#top
Show all changes 1 commit https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files
40e4ad0 RealTimeServer.disconnectAll() implemented. aquamoth May 21, 2017 https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/commits/40e4ad0546d14867ee6bb442d62b02580d174f50
Clear filters https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files
Please reload this pagehttps://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files
Please reload this pagehttps://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files
_real_time_server_test.js https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files#diff-c62f2467f5010a8ab69305891320de5dd655725dbacc0ce2e5b28738133bbde4
_server_test.js https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files#diff-a269a4e0bff380e2a12bdfeacb5f9a6437bf985738a1c0954612b1c57d67232f
real_time_server.js https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files#diff-39780c08948a0c0c1d4ce3f860e5570f0b3bac1b926ceb9f8477f9426ddb3947
server.js https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files#diff-f85e295b34c9835cd9f4b308ba1deea8fc648cb706ae7d4e198cf3585051dee1
src/server/_real_time_server_test.jshttps://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files#diff-c62f2467f5010a8ab69305891320de5dd655725dbacc0ce2e5b28738133bbde4
View file https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/blob/40e4ad0546d14867ee6bb442d62b02580d174f50/src/server/_real_time_server_test.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/{{ revealButtonHref }}
https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files#diff-c62f2467f5010a8ab69305891320de5dd655725dbacc0ce2e5b28738133bbde4
https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files#diff-c62f2467f5010a8ab69305891320de5dd655725dbacc0ce2e5b28738133bbde4
https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files#diff-c62f2467f5010a8ab69305891320de5dd655725dbacc0ce2e5b28738133bbde4
https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files#diff-c62f2467f5010a8ab69305891320de5dd655725dbacc0ce2e5b28738133bbde4
https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files#diff-c62f2467f5010a8ab69305891320de5dd655725dbacc0ce2e5b28738133bbde4
https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files#diff-c62f2467f5010a8ab69305891320de5dd655725dbacc0ce2e5b28738133bbde4
src/server/_server_test.jshttps://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files#diff-a269a4e0bff380e2a12bdfeacb5f9a6437bf985738a1c0954612b1c57d67232f
View file https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/blob/40e4ad0546d14867ee6bb442d62b02580d174f50/src/server/_server_test.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/{{ revealButtonHref }}
https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files#diff-a269a4e0bff380e2a12bdfeacb5f9a6437bf985738a1c0954612b1c57d67232f
https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files#diff-a269a4e0bff380e2a12bdfeacb5f9a6437bf985738a1c0954612b1c57d67232f
src/server/real_time_server.jshttps://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files#diff-39780c08948a0c0c1d4ce3f860e5570f0b3bac1b926ceb9f8477f9426ddb3947
View file https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/blob/40e4ad0546d14867ee6bb442d62b02580d174f50/src/server/real_time_server.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/{{ revealButtonHref }}
https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files#diff-39780c08948a0c0c1d4ce3f860e5570f0b3bac1b926ceb9f8477f9426ddb3947
https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files#diff-39780c08948a0c0c1d4ce3f860e5570f0b3bac1b926ceb9f8477f9426ddb3947
https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files#diff-39780c08948a0c0c1d4ce3f860e5570f0b3bac1b926ceb9f8477f9426ddb3947
https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files#diff-39780c08948a0c0c1d4ce3f860e5570f0b3bac1b926ceb9f8477f9426ddb3947
src/server/server.jshttps://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files#diff-f85e295b34c9835cd9f4b308ba1deea8fc648cb706ae7d4e198cf3585051dee1
View file https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/blob/40e4ad0546d14867ee6bb442d62b02580d174f50/src/server/server.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/{{ revealButtonHref }}
https://patch-diff.githubusercontent.com/jamesshore/lets_code_javascript/pull/13/files#diff-f85e295b34c9835cd9f4b308ba1deea8fc648cb706ae7d4e198cf3585051dee1
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.