René's URL Explorer Experiment


Title: what's the purpose of line_allocated_event for redis? · Issue #70 · cosmicpython/code · GitHub

Open Graph Title: what's the purpose of line_allocated_event for redis? · Issue #70 · cosmicpython/code

X Title: what's the purpose of line_allocated_event for redis? · Issue #70 · cosmicpython/code

Description: Hello, thanks for all the resources you provided in the book, helping me tremendously to understand what a clean architecture could look like in python world. Just have a quick question about this line in end-to-end test: **subscription ...

Open Graph Description: Hello, thanks for all the resources you provided in the book, helping me tremendously to understand what a clean architecture could look like in python world. Just have a quick question about this ...

X Description: Hello, thanks for all the resources you provided in the book, helping me tremendously to understand what a clean architecture could look like in python world. Just have a quick question about this ...

Opengraph URL: https://github.com/cosmicpython/code/issues/70

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"what's the purpose of line_allocated_event for redis?","articleBody":"Hello, thanks for all the resources you provided in the book, helping me tremendously to understand what a clean architecture could look like in python world. Just have a quick question about this line in end-to-end test:\r\n\r\n    **subscription = redis_client.subscribe_to(\"line_allocated\")**\r\n\r\nwhat's line_allocated channel needed for? I could see that the message is getting published to \"change_batch_quantity\" channel but we are subscribed to a different channel but somehow still able to read the messages that come from change_batch_quantity. I might be missing something easy to understand as i don't have a lot of experience with redis pubsub. I thought the channel names should have been same for them to exchange messages. Regardless of it, the tests pass so it seems like i'm missing something here. Thank you\r\n\r\n```\r\n@pytest.mark.usefixtures(\"postgres_db\")\r\n@pytest.mark.usefixtures(\"restart_api\")\r\n@pytest.mark.usefixtures(\"restart_redis_pubsub\")\r\ndef test_change_batch_quantity_leading_to_reallocation():\r\n    # start with two batches and an order allocated to one of them\r\n    orderid, sku = random_orderid(), random_sku()\r\n    earlier_batch, later_batch = random_batchref(\"old\"), random_batchref(\"newer\")\r\n    api_client.post_to_add_batch(earlier_batch, sku, qty=10, eta=\"2011-01-01\")\r\n    api_client.post_to_add_batch(later_batch, sku, qty=10, eta=\"2011-01-02\")\r\n    r = api_client.post_to_allocate(orderid, sku, 10)\r\n    assert r.ok\r\n    response = api_client.get_allocation(orderid)\r\n    assert response.json()[0][\"batchref\"] == earlier_batch\r\n\r\n    **subscription = redis_client.subscribe_to(\"line_allocated\")**\r\n\r\n    # change quantity on allocated batch so it's less than our order\r\n    redis_client.publish_message(\r\n        \"change_batch_quantity\",\r\n        {\"batchref\": earlier_batch, \"qty\": 5},\r\n    )\r\n\r\n    # wait until we see a message saying the order has been reallocated\r\n    messages = []\r\n    for attempt in Retrying(stop=stop_after_delay(3), reraise=True):\r\n        with attempt:\r\n            message = subscription.get_message(timeout=1)\r\n            if message:\r\n                messages.append(message)\r\n                print(messages)\r\n            data = json.loads(messages[-1][\"data\"])\r\n            assert data[\"orderid\"] == orderid\r\n            assert data[\"batchref\"] == later_batch\r\n```","author":{"url":"https://github.com/uguryiilmz","@type":"Person","name":"uguryiilmz"},"datePublished":"2023-05-12T19:44:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/70/code/issues/70"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:a674eb0a-7e3f-fb13-88a1-b7c17c9b81bb
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id95AE:261A6D:3AEF621:513D957:6977DECD
html-safe-nonceb42a62b5266d7942002d752f892912bafce535b8425570bddd1b5dcecb9c6c96
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NUFFOjI2MUE2RDozQUVGNjIxOjUxM0Q5NTc6Njk3N0RFQ0QiLCJ2aXNpdG9yX2lkIjoiMTA5MzA3MDAxNjEyMDA4NjIyMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac70c34f4ba9943e2a2127c9d034afe53ec978f7ba881cbe34df0ba85f73c07fa7
hovercard-subject-tagissue:1708122833
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/cosmicpython/code/70/issue_layout
twitter:imagehttps://opengraph.githubassets.com/95aefec10f36cc674b45e0022cc1010eaadf3c5e9df9f59a2c8e35608bf65ae8/cosmicpython/code/issues/70
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/95aefec10f36cc674b45e0022cc1010eaadf3c5e9df9f59a2c8e35608bf65ae8/cosmicpython/code/issues/70
og:image:altHello, thanks for all the resources you provided in the book, helping me tremendously to understand what a clean architecture could look like in python world. Just have a quick question about this ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameuguryiilmz
hostnamegithub.com
expected-hostnamegithub.com
None8909f95e78dc1ccc1b9acf9d5c963c2515579e48d2898151cf571437facd1d7b
turbo-cache-controlno-preview
go-importgithub.com/cosmicpython/code git https://github.com/cosmicpython/code.git
octolytics-dimension-user_id47350834
octolytics-dimension-user_logincosmicpython
octolytics-dimension-repository_id169221290
octolytics-dimension-repository_nwocosmicpython/code
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id169221290
octolytics-dimension-repository_network_root_nwocosmicpython/code
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
released6b13f6e4712dc1242cf12b5e75dec8b1bf3a9ab
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/cosmicpython/code/issues/70#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcosmicpython%2Fcode%2Fissues%2F70
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://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcosmicpython%2Fcode%2Fissues%2F70
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=cosmicpython%2Fcode
Reloadhttps://github.com/cosmicpython/code/issues/70
Reloadhttps://github.com/cosmicpython/code/issues/70
Reloadhttps://github.com/cosmicpython/code/issues/70
cosmicpython https://github.com/cosmicpython
codehttps://github.com/cosmicpython/code
Notifications https://github.com/login?return_to=%2Fcosmicpython%2Fcode
Fork 1.1k https://github.com/login?return_to=%2Fcosmicpython%2Fcode
Star 2.6k https://github.com/login?return_to=%2Fcosmicpython%2Fcode
Code https://github.com/cosmicpython/code
Issues 26 https://github.com/cosmicpython/code/issues
Pull requests 4 https://github.com/cosmicpython/code/pulls
Actions https://github.com/cosmicpython/code/actions
Projects 0 https://github.com/cosmicpython/code/projects
Security 0 https://github.com/cosmicpython/code/security
Insights https://github.com/cosmicpython/code/pulse
Code https://github.com/cosmicpython/code
Issues https://github.com/cosmicpython/code/issues
Pull requests https://github.com/cosmicpython/code/pulls
Actions https://github.com/cosmicpython/code/actions
Projects https://github.com/cosmicpython/code/projects
Security https://github.com/cosmicpython/code/security
Insights https://github.com/cosmicpython/code/pulse
New issuehttps://github.com/login?return_to=https://github.com/cosmicpython/code/issues/70
New issuehttps://github.com/login?return_to=https://github.com/cosmicpython/code/issues/70
what's the purpose of line_allocated_event for redis?https://github.com/cosmicpython/code/issues/70#top
https://github.com/uguryiilmz
https://github.com/uguryiilmz
uguryiilmzhttps://github.com/uguryiilmz
on May 12, 2023https://github.com/cosmicpython/code/issues/70#issue-1708122833
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.