{"id":3427,"date":"2022-12-07T10:33:06","date_gmt":"2022-12-07T10:33:06","guid":{"rendered":"http:\/\/the-codest.localhost\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/"},"modified":"2026-03-09T13:04:35","modified_gmt":"2026-03-09T13:04:35","slug":"laer-mere-om-ruby-on-rails-med-pub-sub","status":"publish","type":"post","link":"https:\/\/thecodest.co\/da\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/","title":{"rendered":"F\u00e5 mere at vide om Ruby on Rails med Pub\/Sub"},"content":{"rendered":"<p><strong><a href=\"https:\/\/thecodest.co\/da\/case-studies\/providing-a-team-of-ruby-developers-for-a-fintech-company\/\">Ruby<\/a> p\u00e5 <a href=\"https:\/\/thecodest.co\/da\/blog\/ways-to-increase-your-rails-performance\/\">Skinner<\/a><\/strong> (Rails, <a href=\"https:\/\/thecodest.co\/da\/blog\/hire-ror-developer\/\">RoR<\/a>) er en velkendt <a href=\"https:\/\/thecodest.co\/da\/blog\/find-your-ideal-stack-for-web-development\/\">web<\/a> applikationsrammev\u00e6rk skrevet i <strong>Ruby<\/strong> programmeringssprog. <strong>Pub\/Sub<\/strong> er et kort navn for softwaredesignm\u00f8nstre kaldet <b>Udgiv-abonnement<\/b>. Jeg vil forklare, hvordan kommunikation mellem softwarekomponenter i Rails kan h\u00e5ndteres af Pub\/Sub.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Hvad er Pub\/sub?<\/h2>\n\n\n\n<p><strong>Pub\/sub<\/strong> er et softwaredesignm\u00f8nster, der giver service-til-service-kommunikation. Service<br>indeb\u00e6rer en af de to roller: udgiver (som producerer) eller modtager (som forbruger). Hvad er<br>der skal forbruges, bestemmes som en begivenhed eller en besked eller en notifikation. I<br>I denne artikel bruges de i fl\u00e6ng om det samme.<br>Den tjeneste, der producerer, ved ikke, hvem der forbruger. Den tjeneste, der forbruger, ved ikke<br>kender beskedens oprindelse. De kan forblive ukendte for hinanden. Det er forskelligt fra<br>beskedk\u00f8er, hvor den komponent, der sender beskeden, ofte kender dens destination<br>- Denne m\u00e5de at sende beskeder p\u00e5 giver dig mulighed for at sende beskeder hvor som helst. Denne mekanisme er en kerne<br>af <strong>Pub\/sub<\/strong> og det betyder, at de er afkoblede.<\/p>\n\n\n\n<p>For at udtrykke deres f\u00e6lles interesser skal de have en f\u00e6lles forst\u00e5else. Det er derfor,<br>Begge roller har en implicit stokkemekanisme, hvor producenten af en besked og modtageren af den<br>forbruger af meddelelsen m\u00f8des. Denne mekanisme kaldes emne, abonnement eller topic. Den er<br>ansvarlig for at kategorisere meddelelser til emner, er det i bund og grund et tilstandsl\u00f8st meddelelsesfilter.<br>Emner fungerer som radiostationer. En udgiver producerer beskeden til emnet,<br>abonnenter modtager straks beskeden fra emnet. P\u00e5 grund af den afkoblede<br>tjenester, er den mest effektive m\u00e5de at udveksle beskeder p\u00e5 at h\u00e5ndtere dem asynkront.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Rails uden Pub\/Sub<\/h2>\n\n\n\n<p>Som standard er der ingen Rails-overhead for softwaredesignm\u00f8nstre til overf\u00f8rsel af beskeder mellem komponenter. Udviklere bruger standard <strong>objektorienteret programmering<\/strong> (<a href=\"https:\/\/thecodest.co\/da\/dictionary\/object-oriented-programming-oop\/\">OOP<\/a>) paradigme: sende parametre til funktioner, bede om klasser om v\u00e6rdier.<\/p>\n\n\n\n<p>N\u00e5r applikationen er ret ukompliceret, kan det v\u00e6re nok. N\u00e5r applikationen vokser, skal nogle operationer f.eks. udf\u00f8res asynkront, og s\u00e5 er <a href=\"https:\/\/thecodest.co\/da\/dictionary\/why-do-projects-fail\/\">projekt<\/a> har brug for en abstraktion, der l\u00f8ser det <a href=\"https:\/\/thecodest.co\/da\/blog\/app-data-collection-security-risks-value-and-types-explored\/\">data<\/a> arbejdsgang. I stedet for at genopfinde hjulet kan udviklere implementere <strong>Pub\/sub<\/strong> for at udfylde denne mangel p\u00e5 abstraktion.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Fordele ved Pub\/Sub med Rails<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Undg\u00e5 tilbagekaldelser af aktive poster.<\/li>\n\n\n\n<li>Ved at tilf\u00f8je asynkron parallel behandling til et system \u00f8ges ydeevnen, p\u00e5lideligheden og <a href=\"https:\/\/thecodest.co\/da\/blog\/difference-between-elasticity-and-scalability-in-cloud-computing\/\">skalerbarhed<\/a> er forbedret.<\/li>\n\n\n\n<li>Beskeder kan sendes asynkront til forskellige dele af systemet.<\/li>\n\n\n\n<li>Giver mulighed for at sende beskeder asynkront til forskellige dele af et system.<\/li>\n\n\n\n<li>Afkobling - tilf\u00f8jelse eller \u00e6ndring af en funktionalitet vil ikke p\u00e5virke noget, fordi Pub\/Sub<br>giver dig mulighed for at \u00e6ndre, hvordan alting interagerer.<\/li>\n\n\n\n<li>Beskedforbrugeren beh\u00f8ver ikke l\u00e6ngere regelm\u00e6ssigt at tjekke for opdateringer eller nye<br>information. Det reducerer leveringsforsinkelsen, som kan v\u00e6re s\u00e6rligt problematisk i systemer<br>uden tolerance over for forsinkelser.<\/li>\n\n\n\n<li>Der er ingen gr\u00e6nse for, hvor mange abonnenter systemet kan h\u00e5ndtere, for det kan \u00e6ndre sig,<br>opgradere, formere sig eller forsvinde n\u00e5r som helst.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Ulemper ved Pub\/Sub med Rails<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Den st\u00f8rste ulempe ved Pub\/sub-systemer er deres afkobling af udgiver og<br>abonnent.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Rails Pub\/Sub introducerer<\/h2>\n\n\n\n<p>Eksempler p\u00e5 kilde i Rails blev skrevet ved hj\u00e6lp af biblioteket<br><a href=\"https:\/\/github.com\/stevo\/pubsub_on_rails\" rel=\"nofollow\">Pub\/Sub p\u00e5 Rails<\/a> (i Rubys nomenklatur kaldes et bibliotek for gem): Du finder flere detaljer i gem'ens readme. Implementeringen er sammensat af moduler:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Dom\u00e6ne,<\/li>\n\n\n\n<li>Begivenhed,<\/li>\n\n\n\n<li>H\u00e6ndelsesh\u00e5ndtering,<\/li>\n\n\n\n<li>Udgiver af begivenheden,<\/li>\n\n\n\n<li>Abonnement.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Dom\u00e6ne<\/h3>\n\n\n\n<p>Beskriver forretningslogik for at give kontekst til Pub\/Sub og derfor g\u00f8re den ren. <a href=\"https:\/\/thecodest.co\/da\/dictionary\/what-is-code-refactoring\/\">Kode<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"> modul Notifikationer\n   extend PubSub::Dom\u00e6ne\n slutning<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"> modul Rapporter\n   extend PubSub::Dom\u00e6ne\n slut\n\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Begivenhed<\/h3>\n\n\n\n<p>Det er en klasse, som beskriver, hvad der skete. Erkl\u00e6r klassens navn s\u00e5 selvbeskrivende med det, der skete, som muligt, for eksempel: annulleret, \u00e6ndret, oprettet, \u00f8delagt, sendt, opdateret. Begivenhedsnavne kan se ud som: ProfitAndLossStatementCreatedEvent, som betyder, at der blev oprettet et \u00e5rsregnskab.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"> class Reports::ProfitAndLossStatementCreatedEvent &lt; PubSub::DomainEvent\n   attribut :profit_and_loss_statement_id, Types::Strict::Integer\n end<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Udgiver af begivenheder<\/h3>\n\n\n\n<p>Klasse, der kan udsende h\u00e6ndelser. Eksemplet viser oprettelse af en servicerapport. N\u00e5r rapporten er oprettet, udsendes h\u00e6ndelsen for oprettelsen af rapporten.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">klasse Reports::ProfitAndLossStatementService\n   inkluderer PubSub::Emit\n    def udf\u00f8r\n     emit(:report_profit_and_loss_statement_created, profit_and_loss_statement_id: id) if result.ok?\n   end\n end<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">H\u00e6ndelsesh\u00e5ndtering<\/h3>\n\n\n\n<p>Denne klasse skal udf\u00f8res som svar p\u00e5 h\u00e5ndtering af en h\u00e6ndelse.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">modul Notifikationer\n class ReportsProfitAndLossStatementCreatedHandler &lt; PubSub::DomainEventHandler\n   def kald\n     ReportMailer.profit_and_loss_statement(profit_and_loss_statement).deliver_now\n   slut\n\n   privat\n\n   def opg\u00f8relse_overskud_og_tab\n     ProfitAndLossStatement.find(event_data.profit_and_loss_statement_id)\n   slut\n end\nend<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Abonnement<\/h3>\n\n\n\n<p>Begivenheder er bundet til deres behandlere gennem abonnementer.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">meddelelser:\n reports__profit_and_loss_statement_created: async<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Eksempler p\u00e5 brugsscenarier:<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\"F\u00f8lg\"-funktionen i sociale netv\u00e6rk,<\/li>\n\n\n\n<li>Tingenes internet,<\/li>\n\n\n\n<li>Mailing,<\/li>\n\n\n\n<li>Meddelelse om genererede filer.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Lignende m\u00f8nstre<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><b>EventBus<\/b> - komponenter kan sende begivenheder til EventBus uden at vide, hvem der vil samle dem op, eller hvor mange respondenter der vil komme. <a href=\"https:\/\/thecodest.co\/da\/blog\/react-development-all-you-have-to-know\/\">reagere<\/a>,<\/li>\n\n\n\n<li><b>Observat\u00f8r<\/b> - opretholder subjektet en liste over afh\u00e6ngige personer, kaldet observat\u00f8rer, og giver dem besked, n\u00e5r deres tilstand \u00e6ndres,<\/li>\n\n\n\n<li><b>Sammenl\u00e6gning<\/b> - Ved polling sp\u00f8rger klienter med j\u00e6vne mellemrum systemet, om der er nye begivenheder eller data.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">\u00c6delstene<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<p><a href=\"https:\/\/github.com\/edisonywh\/rocketman\" rel=\"nofollow\">https:\/\/github.com\/edisonywh\/rocketman<\/a><\/p>\n<\/li>\n\n\n\n<li>\n<p><a href=\"https:\/\/github.com\/krisleech\/wisper\" rel=\"nofollow\">https:\/\/github.com\/krisleech\/wisper<\/a><\/p>\n<\/li>\n\n\n\n<li>\n<p><a href=\"https:\/\/github.com\/stevo\/pubsub_on_rails\" rel=\"nofollow\">https:\/\/github.com\/stevo\/pubsub<em>p\u00e5<\/em>Skinner<\/a><\/p>\n<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Sammenfatning<\/h2>\n\n\n\n<p>Pub\/sub er ikke en almindelig tilgang i Ruby in Rails. Som introduceret i artiklen kan dette m\u00f8nster give mange fordele til projektet - det kan g\u00f8re koden ren, afkoble tjenester og g\u00f8re dem let skalerbare.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/thecodest.co\/contact\"><img decoding=\"async\" src=\"\/app\/uploads\/2024\/05\/interested_in_cooperation_.png\" alt=\"Samarbejdsbanner\"\/><\/a><\/figure>","protected":false},"excerpt":{"rendered":"<p>Pub\/Sub kan give mange fordele til projektet - det kan g\u00f8re koden ren, afkoble tjenester og g\u00f8re dem let skalerbare. L\u00e6r mere om Pub\/Sub i den f\u00f8lgende artikel, og f\u00e5 dit projekt op i niveau!<\/p>","protected":false},"author":2,"featured_media":3428,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[8],"tags":[12],"class_list":["post-3427","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-development","tag-it"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Learn More about Ruby on Rails with Pub\/Sub - The Codest<\/title>\n<meta name=\"description\" content=\"Explore the Pub\/Sub design pattern in Ruby on Rails and see how it enables event-driven communication and scalable system architecture.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thecodest.co\/da\/blog\/laer-mere-om-ruby-on-rails-med-pub-sub\/\" \/>\n<meta property=\"og:locale\" content=\"da_DK\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Learn More about Ruby on Rails with Pub\/Sub\" \/>\n<meta property=\"og:description\" content=\"Explore the Pub\/Sub design pattern in Ruby on Rails and see how it enables event-driven communication and scalable system architecture.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thecodest.co\/da\/blog\/laer-mere-om-ruby-on-rails-med-pub-sub\/\" \/>\n<meta property=\"og:site_name\" content=\"The Codest\" \/>\n<meta property=\"article:published_time\" content=\"2022-12-07T10:33:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-09T13:04:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/ruby_on_rails_with_pubsub.png\" \/>\n\t<meta property=\"og:image:width\" content=\"960\" \/>\n\t<meta property=\"og:image:height\" content=\"540\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"thecodest\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"thecodest\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/\"},\"author\":{\"name\":\"thecodest\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\"},\"headline\":\"Learn More about Ruby on Rails with Pub\\\/Sub\",\"datePublished\":\"2022-12-07T10:33:06+00:00\",\"dateModified\":\"2026-03-09T13:04:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/\"},\"wordCount\":778,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/ruby_on_rails_with_pubsub.png\",\"keywords\":[\"IT\"],\"articleSection\":[\"Software Development\"],\"inLanguage\":\"da-DK\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/\",\"name\":\"Learn More about Ruby on Rails with Pub\\\/Sub - The Codest\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/ruby_on_rails_with_pubsub.png\",\"datePublished\":\"2022-12-07T10:33:06+00:00\",\"dateModified\":\"2026-03-09T13:04:35+00:00\",\"description\":\"Explore the Pub\\\/Sub design pattern in Ruby on Rails and see how it enables event-driven communication and scalable system architecture.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/#breadcrumb\"},\"inLanguage\":\"da-DK\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"da-DK\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/#primaryimage\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/ruby_on_rails_with_pubsub.png\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/ruby_on_rails_with_pubsub.png\",\"width\":960,\"height\":540},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/thecodest.co\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Learn More about Ruby on Rails with Pub\\\/Sub\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"name\":\"The Codest\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/thecodest.co\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"da-DK\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\",\"name\":\"The Codest\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"da-DK\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"width\":144,\"height\":36,\"caption\":\"The Codest\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/pl.linkedin.com\\\/company\\\/codest\",\"https:\\\/\\\/clutch.co\\\/profile\\\/codest\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\",\"name\":\"thecodest\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"da-DK\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"caption\":\"thecodest\"},\"url\":\"https:\\\/\\\/thecodest.co\\\/da\\\/author\\\/thecodest\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"F\u00e5 mere at vide om Ruby on Rails med Pub\/Sub - The Codest","description":"Udforsk Pub\/Sub-designm\u00f8nsteret i Ruby on Rails, og se, hvordan det muligg\u00f8r h\u00e6ndelsesdrevet kommunikation og skalerbar systemarkitektur.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/thecodest.co\/da\/blog\/laer-mere-om-ruby-on-rails-med-pub-sub\/","og_locale":"da_DK","og_type":"article","og_title":"Learn More about Ruby on Rails with Pub\/Sub","og_description":"Explore the Pub\/Sub design pattern in Ruby on Rails and see how it enables event-driven communication and scalable system architecture.","og_url":"https:\/\/thecodest.co\/da\/blog\/laer-mere-om-ruby-on-rails-med-pub-sub\/","og_site_name":"The Codest","article_published_time":"2022-12-07T10:33:06+00:00","article_modified_time":"2026-03-09T13:04:35+00:00","og_image":[{"width":960,"height":540,"url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/ruby_on_rails_with_pubsub.png","type":"image\/png"}],"author":"thecodest","twitter_card":"summary_large_image","twitter_misc":{"Written by":"thecodest","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/#article","isPartOf":{"@id":"https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/"},"author":{"name":"thecodest","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76"},"headline":"Learn More about Ruby on Rails with Pub\/Sub","datePublished":"2022-12-07T10:33:06+00:00","dateModified":"2026-03-09T13:04:35+00:00","mainEntityOfPage":{"@id":"https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/"},"wordCount":778,"commentCount":0,"publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"image":{"@id":"https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/ruby_on_rails_with_pubsub.png","keywords":["IT"],"articleSection":["Software Development"],"inLanguage":"da-DK","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/","url":"https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/","name":"F\u00e5 mere at vide om Ruby on Rails med Pub\/Sub - The Codest","isPartOf":{"@id":"https:\/\/thecodest.co\/#website"},"primaryImageOfPage":{"@id":"https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/#primaryimage"},"image":{"@id":"https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/ruby_on_rails_with_pubsub.png","datePublished":"2022-12-07T10:33:06+00:00","dateModified":"2026-03-09T13:04:35+00:00","description":"Udforsk Pub\/Sub-designm\u00f8nsteret i Ruby on Rails, og se, hvordan det muligg\u00f8r h\u00e6ndelsesdrevet kommunikation og skalerbar systemarkitektur.","breadcrumb":{"@id":"https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/#breadcrumb"},"inLanguage":"da-DK","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/"]}]},{"@type":"ImageObject","inLanguage":"da-DK","@id":"https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/#primaryimage","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/ruby_on_rails_with_pubsub.png","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/ruby_on_rails_with_pubsub.png","width":960,"height":540},{"@type":"BreadcrumbList","@id":"https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thecodest.co\/"},{"@type":"ListItem","position":2,"name":"Learn More about Ruby on Rails with Pub\/Sub"}]},{"@type":"WebSite","@id":"https:\/\/thecodest.co\/#website","url":"https:\/\/thecodest.co\/","name":"Codest","description":"","publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thecodest.co\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"da-DK"},{"@type":"Organization","@id":"https:\/\/thecodest.co\/#organization","name":"Codest","url":"https:\/\/thecodest.co\/","logo":{"@type":"ImageObject","inLanguage":"da-DK","@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","width":144,"height":36,"caption":"The Codest"},"image":{"@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/pl.linkedin.com\/company\/codest","https:\/\/clutch.co\/profile\/codest"]},{"@type":"Person","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76","name":"thecodest","image":{"@type":"ImageObject","inLanguage":"da-DK","@id":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","caption":"thecodest"},"url":"https:\/\/thecodest.co\/da\/author\/thecodest\/"}]}},"_links":{"self":[{"href":"https:\/\/thecodest.co\/da\/wp-json\/wp\/v2\/posts\/3427","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecodest.co\/da\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecodest.co\/da\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecodest.co\/da\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thecodest.co\/da\/wp-json\/wp\/v2\/comments?post=3427"}],"version-history":[{"count":8,"href":"https:\/\/thecodest.co\/da\/wp-json\/wp\/v2\/posts\/3427\/revisions"}],"predecessor-version":[{"id":7913,"href":"https:\/\/thecodest.co\/da\/wp-json\/wp\/v2\/posts\/3427\/revisions\/7913"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecodest.co\/da\/wp-json\/wp\/v2\/media\/3428"}],"wp:attachment":[{"href":"https:\/\/thecodest.co\/da\/wp-json\/wp\/v2\/media?parent=3427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecodest.co\/da\/wp-json\/wp\/v2\/categories?post=3427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecodest.co\/da\/wp-json\/wp\/v2\/tags?post=3427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}