{"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":"laerdu-meira-um-ruby-on-rails-med-birgja-askrifanda","status":"publish","type":"post","link":"https:\/\/thecodest.co\/is\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/","title":{"rendered":"F\u00e1\u00f0u n\u00e1nari uppl\u00fdsingar um Ruby on Rails me\u00f0 Pub\/Sub"},"content":{"rendered":"<p><strong><a href=\"https:\/\/thecodest.co\/is\/case-studies\/providing-a-team-of-ruby-developers-for-a-fintech-company\/\">R\u00fab\u00edn<\/a> \u00e1 <a href=\"https:\/\/thecodest.co\/is\/blog\/ways-to-increase-your-rails-performance\/\">Relsar<\/a><\/strong> (Relsar, <a href=\"https:\/\/thecodest.co\/is\/blog\/hire-ror-developer\/\">R\u00e9ttur til afturkomu<\/a>) er vel \u00feekktur <a href=\"https:\/\/thecodest.co\/is\/blog\/find-your-ideal-stack-for-web-development\/\">vefur<\/a> forritarammi skrifa\u00f0ur \u00ed <strong>R\u00fab\u00edn<\/strong> forritunarm\u00e1l. <strong>Birta\/\u00e1skrifa<\/strong> er stutt nafn \u00e1 hugb\u00fana\u00f0arh\u00f6nnunarmynstrum sem kallast <b>Birta\u2013\u00e1skrifa<\/b>. \u00c9g mun \u00fatsk\u00fdra hvernig samskipti milli hugb\u00fana\u00f0areininga \u00ed Rails g\u00e6tu veri\u00f0 leyst me\u00f0 Pub\/Sub.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Hva\u00f0 er Pub\/sub?<\/h2>\n\n\n\n<p><strong>Birta\/\u00e1skrifa<\/strong> er hugb\u00fana\u00f0arh\u00f6nnunarmynstur sem gerir \u00fej\u00f3nustu kleift a\u00f0 eiga samskipti s\u00edn \u00e1 milli. \u00dej\u00f3nusta<br>felur \u00ed s\u00e9r anna\u00f0 af tveimur hlutverkum: \u00fatgefanda (sem framlei\u00f0ir) e\u00f0a vi\u00f0takanda (sem neytir). Hva\u00f0 er<br>framleitt til neyslu er \u00e1kvar\u00f0a\u00f0 sem atbur\u00f0ur e\u00f0a skilabo\u00f0 e\u00f0a tilkynning. \u00cd<br>\u00cd samhengi \u00feessarar greinar eru \u00feau notu\u00f0 skiptum saman til a\u00f0 v\u00edsa til sama hlutar.<br>\u00dej\u00f3nustan sem framlei\u00f0ir veit ekki hver neytir. \u00dej\u00f3nustan sem neytir veit ekki<br>\u00deekkja uppruna skilabo\u00f0anna. \u00deeir geta veri\u00f0 \u00f3\u00feekktir hver \u00f6\u00f0rum. \u00dea\u00f0 er \u00f6\u00f0ruv\u00edsi en<br>Skilabo\u00f0ara\u00f0ir, \u00fear sem \u00edhlutinn sem sendir skilabo\u00f0in \u00feekkir oft \u00e1fangasta\u00f0inn sinn.<br>\u2013 \u00feessi st\u00edll skilabo\u00f0ami\u00f0lunar gerir \u00fe\u00e9r kleift a\u00f0 senda skilabo\u00f0 hvar sem er. \u00deessi a\u00f0fer\u00f0 er kjarni<br>af <strong>Birta\/\u00e1skrifa<\/strong> og \u00fea\u00f0 \u00fe\u00fd\u00f0ir a\u00f0 \u00feau eru aftengd.<\/p>\n\n\n\n<p>Til a\u00f0 tj\u00e1 gagnkv\u00e6m hagsmuni s\u00edn ver\u00f0a \u00feeir a\u00f0 deila sameiginlegri skilningi. \u00deess vegna,<br>b\u00e1\u00f0ar hlutverk hafa \u00f3beina refishv\u00f6rf \u00fear sem framlei\u00f0andi skilabo\u00f0a og<br>neytandi skilabo\u00f0a sem m\u00e6tir. \u00deessi v\u00e9lb\u00fana\u00f0ur kallast vi\u00f0fangsefni, \u00e1skrift e\u00f0a efni. \u00dea\u00f0 er<br>\u00c1byrgur fyrir a\u00f0 flokka skilabo\u00f0 eftir efni, er \u00fea\u00f0 \u00ed e\u00f0li s\u00ednu stateless skilabo\u00f0as\u00edu.<br>\u00deemu virka sem \u00fatsendingast\u00f6\u00f0var. \u00datgefandi framlei\u00f0ir skilabo\u00f0in til \u00feemasins,<br>\u00e1skrifendur f\u00e1 strax skilabo\u00f0in fr\u00e1 vi\u00f0fangsefninu. Vegna afk\u00faplunar<br>\u00dej\u00f3nustur, skilvirkasta lei\u00f0in til a\u00f0 skiptast \u00e1 skilabo\u00f0um er a\u00f0 vinna \u00far \u00feeim \u00e1 \u00f3samstilltan h\u00e1tt.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Rails \u00e1n Pub\/Sub<\/h2>\n\n\n\n<p>\u00c1 sj\u00e1lfgefinni stillingu er engin Rails-vi\u00f0b\u00f3t fyrir hugb\u00fana\u00f0arh\u00f6nnunarmynstur til a\u00f0 senda skilabo\u00f0 \u00e1 milli \u00edhluta. Forritarar nota sta\u00f0la\u00f0a <strong>hlutbundin forritun<\/strong> (<a href=\"https:\/\/thecodest.co\/is\/dictionary\/object-oriented-programming-oop\/\">OOP<\/a>) fyrirmynd: a\u00f0 senda breytur til fallanna, a\u00f0 bi\u00f0ja um flokka um gildi.<\/p>\n\n\n\n<p>\u00deegar forriti\u00f0 er frekar einfalt g\u00e6ti \u00fea\u00f0 duga\u00f0. \u00deegar forriti\u00f0 st\u00e6kkar, til d\u00e6mis, \u00fearf a\u00f0 framkv\u00e6ma sumar a\u00f0ger\u00f0ir \u00f3samstillt, \u00fe\u00e1 \u2026 <a href=\"https:\/\/thecodest.co\/is\/dictionary\/why-do-projects-fail\/\">verkefni<\/a> \u00fearf abstraktj\u00f3n sem leysir \u00fea\u00f0 <a href=\"https:\/\/thecodest.co\/is\/blog\/app-data-collection-security-risks-value-and-types-explored\/\">g\u00f6gn<\/a> vinnslaferli. \u00cd sta\u00f0 \u00feess a\u00f0 enduruppg\u00f6tva hj\u00f3li\u00f0 geta forritarar innleitt <strong>Birta\/\u00e1skrifa<\/strong> til a\u00f0 fylla \u00feennan skort \u00e1 abstraktun.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Kostir Pub\/Sub me\u00f0 Rails<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>For\u00f0astu Active Record callbacks.<\/li>\n\n\n\n<li>Me\u00f0 \u00fev\u00ed a\u00f0 b\u00e6ta vi\u00f0 \u00f3samhverfri samhli\u00f0a \u00farvinnslu \u00ed kerfi batna frammista\u00f0a, \u00e1rei\u00f0anleiki og <a href=\"https:\/\/thecodest.co\/is\/blog\/difference-between-elasticity-and-scalability-in-cloud-computing\/\">Stigst\u00e6r\u00f0<\/a> eru b\u00e6tt.<\/li>\n\n\n\n<li>Skilabo\u00f0 m\u00e1 senda \u00fat \u00f3samhli\u00f0a til mismunandi hluta kerfisins.<\/li>\n\n\n\n<li>Leyfir a\u00f0 senda skilabo\u00f0 \u00f3samhli\u00f0a til mismunandi hluta kerfisins.<\/li>\n\n\n\n<li>A\u00f0skilna\u00f0ur \u2013 a\u00f0 b\u00e6ta vi\u00f0 e\u00f0a breyta virkni mun ekki hafa \u00e1hrif \u00e1 neitt vegna Pub\/Sub<br>Leyfir \u00fe\u00e9r a\u00f0 breyta hvernig allt hefur samskipti.<\/li>\n\n\n\n<li>Skilabo\u00f0aneytandinn \u00fearf ekki lengur a\u00f0 athuga reglulega hvort uppf\u00e6rslur e\u00f0a n\u00fdjar s\u00e9u til.<br>uppl\u00fdsingar. \u00dea\u00f0 dregur \u00far afhendingart\u00f6fum sem geta veri\u00f0 s\u00e9rstaklega vandam\u00e1l \u00ed kerfum<br>\u00e1n \u00feolinm\u00e6\u00f0i fyrir t\u00f6fum.<\/li>\n\n\n\n<li>\u00dea\u00f0 er engin takm\u00f6rkun \u00e1 \u00fev\u00ed hversu marga \u00e1skrifendur kerfi\u00f0 getur sinnt, \u00fev\u00ed \u00fea\u00f0 getur breyst,<br>uppf\u00e6ra, margfalast e\u00f0a hverfa hven\u00e6r sem er.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u00d3kostir Pub\/Sub me\u00f0 Rails<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Helsti \u00f3kostur vi\u00f0 birtingar-\/\u00e1skriftarkerfi er a\u00f0skilna\u00f0ur birgis og<br>\u00e1skrifandi.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Kynning \u00e1 Rails Pub\/Sub<\/h2>\n\n\n\n<p>D\u00e6mi um uppsprettu \u00ed Rails var skrifa\u00f0 me\u00f0 b\u00f3kasafni.<br><a href=\"https:\/\/github.com\/stevo\/pubsub_on_rails\" rel=\"nofollow\">Birgja\/\u00e1skrifendakerfi \u00ed Rails<\/a> (\u00ed Ruby-heitihef\u00f0 er b\u00f3kasafn kalla\u00f0 gem): \u00de\u00fa finnur n\u00e1nari uppl\u00fdsingar \u00ed readme-skr\u00e1 gemsins. Framkv\u00e6mdin samanstendur af einingum:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>L\u00e9n,<\/li>\n\n\n\n<li>Vi\u00f0bur\u00f0ur,<\/li>\n\n\n\n<li>Vi\u00f0bur\u00f0ahandfari,<\/li>\n\n\n\n<li>Vi\u00f0bur\u00f0arg\u00e1fandi,<\/li>\n\n\n\n<li>\u00e1skrift.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">L\u00e9n<\/h3>\n\n\n\n<p>L\u00fdsir vi\u00f0skiptal\u00f3g\u00edk til a\u00f0 veita samhengi fyrir Pub\/Sub og \u00feannig gera \u00fea\u00f0 hreint <a href=\"https:\/\/thecodest.co\/is\/dictionary\/what-is-code-refactoring\/\">k\u00f3\u00f0i<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"> tilkynningar\n   framlengir PubSub::Domain\n end<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"> module Reports\n   extend PubSub::Domain\n end\n\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Vi\u00f0bur\u00f0ur<\/h3>\n\n\n\n<p>\u00deetta er flokkur sem l\u00fdsir \u00fev\u00ed sem ger\u00f0ist. L\u00fdstu nafni flokksins sem sj\u00e1lfsk\u00fdrandi me\u00f0 \u00fev\u00ed sem ger\u00f0ist, til d\u00e6mis: felldur ni\u00f0ur, breyttur, b\u00fainn til, eytt, sendur, uppf\u00e6r\u00f0ur. Atbur\u00f0anafni geta liti\u00f0 svona \u00fat: ProfitAndLossStatementCreatedEvent, sem \u00fe\u00fd\u00f0ir a\u00f0 fj\u00e1rhagsyfirlit hafi veri\u00f0 b\u00fai\u00f0 til.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"> class Reports::ProfitAndLossStatementCreatedEvent &lt; PubSub::DomainEvent\n   attribute :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\">Vi\u00f0bur\u00f0argagnaveitandi<\/h3>\n\n\n\n<p>Flokkur sem getur sent atbur\u00f0i. D\u00e6mi\u00f0 s\u00fdnir hvernig b\u00faa m\u00e1 til \u00fej\u00f3nustusk\u00fdrslu. \u00deegar sk\u00fdrslan er b\u00fain til me\u00f0 g\u00f3\u00f0um \u00e1rangri er sent atbur\u00f0ur um \u00fea\u00f0.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">class Reports::ProfitAndLossStatementService\n   include PubSub::Emit\n    def execute\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\">Vi\u00f0bur\u00f0ahandfari<\/h3>\n\n\n\n<p>\u00deetta forrit \u00e6tti a\u00f0 keyra sem svar vi\u00f0 me\u00f0h\u00f6ndlun atbur\u00f0ar.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">module Notifications\n class ReportsProfitAndLossStatementCreatedHandler &lt; PubSub::DomainEventHandler\n   def call\n ReportMailer.profit_and_loss_statement(profit_and_loss_statement).deliver_now\n   end\n\n   private\n\n   def profit_and_loss_statement\n ProfitAndLossStatement.find(event_data.profit_and_loss_statement_id)\n   end\n end\nend<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u00e1skrift<\/h3>\n\n\n\n<p>Atbur\u00f0ir eru tengdir vi\u00f0h\u00f6ndlara s\u00edna me\u00f0 \u00e1skriftum.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">tilkynningar:\n sk\u00fdrslur__hagna\u00f0arsk\u00fdrsla_b\u00fain_til: async<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">D\u00e6mi um notkunartilvik:<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u201cFylgja\u201d-eiginleiki \u00ed samf\u00e9lagsnetum,<\/li>\n\n\n\n<li>Internet hlutanna,<\/li>\n\n\n\n<li>P\u00f3stsending,<\/li>\n\n\n\n<li>Tilkynning um b\u00fana skr\u00e1r.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Svipu\u00f0 mynstur<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><b>Vi\u00f0bur\u00f0arbyssa<\/b> \u2013 \u00de\u00e6ttir geta sent atbur\u00f0i til EventBus \u00e1n \u00feess a\u00f0 vita hver muni taka \u00fe\u00e1 upp e\u00f0a hversu margir vi\u00f0brag\u00f0sa\u00f0ilar muni <a href=\"https:\/\/thecodest.co\/is\/blog\/react-development-all-you-have-to-know\/\">react<\/a>,<\/li>\n\n\n\n<li><b>\u00c1horfandi<\/b> \u2013 vi\u00f0fangsefni\u00f0 heldur lista yfir h\u00e1\u00f0 a\u00f0ila, sem kallast \u00e1horfendur, og tilkynnir \u00feeim um breytingar \u00e1 \u00e1standi s\u00ednu,<\/li>\n\n\n\n<li><b>Samlagning<\/b> \u2013 vi\u00f0 fyrirspurnir spyrja vi\u00f0skiptavinir kerfi\u00f0 reglulega hvort einhverjar n\u00fdjar atbur\u00f0ir e\u00f0a g\u00f6gn s\u00e9u til.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Gersemar<\/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>\u00e1<\/em>j\u00e1rnbrautir<\/a><\/p>\n<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Yfirlit<\/h2>\n\n\n\n<p>Pub\/sub er ekki algeng n\u00e1lgun \u00ed Ruby on Rails. Eins og fram kemur \u00ed greininni getur \u00feetta mynstur f\u00e6rt verkefninu margv\u00edslega kosti \u2013 \u00fea\u00f0 getur gert k\u00f3\u00f0ann hreinan, losa\u00f0 \u00fej\u00f3nusturnar og gert \u00fe\u00e6r au\u00f0veldlega st\u00e6kkanlegar.<\/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=\"samstarfsf\u00e1ninn\"\/><\/a><\/figure>","protected":false},"excerpt":{"rendered":"<p>Pub\/Sub getur f\u00e6rt verkefninu margv\u00edslega kosti \u2013 \u00fea\u00f0 getur gert k\u00f3\u00f0ann hreinan, losa\u00f0 \u00fej\u00f3nusturnar og gert \u00fe\u00e6r au\u00f0veldlega st\u00e6kkanlegar. L\u00e6r\u00f0u meira um Pub\/Sub \u00ed eftirfarandi grein og lyftu verkefninu \u00fe\u00ednu \u00e1 n\u00e6sta stig!<\/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\/is\/blogg\/laerdu-meira-um-ruby-on-rails-med-birgja-askrifanda\/\" \/>\n<meta property=\"og:locale\" content=\"is_IS\" \/>\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\/is\/blogg\/laerdu-meira-um-ruby-on-rails-med-birgja-askrifanda\/\" \/>\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\":\"is\",\"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\":\"is\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"is\",\"@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\":\"is\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\",\"name\":\"The Codest\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"is\",\"@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\":\"is\",\"@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\\\/is\\\/author\\\/thecodest\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"F\u00e1\u00f0u n\u00e1nari uppl\u00fdsingar um Ruby on Rails me\u00f0 Pub\/Sub - The Codest","description":"Kanna\u00f0u Pub\/Sub h\u00f6nnunarmynstri\u00f0 \u00ed Ruby on Rails og sj\u00e1\u00f0u hvernig \u00fea\u00f0 gerir kleift atbur\u00f0adrifna samskipti og stigst\u00e6r\u00f0a kerfish\u00f6nnun.","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\/is\/blogg\/laerdu-meira-um-ruby-on-rails-med-birgja-askrifanda\/","og_locale":"is_IS","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\/is\/blogg\/laerdu-meira-um-ruby-on-rails-med-birgja-askrifanda\/","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":"is","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\u00e1\u00f0u n\u00e1nari uppl\u00fdsingar um Ruby on Rails me\u00f0 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":"Kanna\u00f0u Pub\/Sub h\u00f6nnunarmynstri\u00f0 \u00ed Ruby on Rails og sj\u00e1\u00f0u hvernig \u00fea\u00f0 gerir kleift atbur\u00f0adrifna samskipti og stigst\u00e6r\u00f0a kerfish\u00f6nnun.","breadcrumb":{"@id":"https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/#breadcrumb"},"inLanguage":"is","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/"]}]},{"@type":"ImageObject","inLanguage":"is","@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":"is"},{"@type":"Organization","@id":"https:\/\/thecodest.co\/#organization","name":"The Codest","url":"https:\/\/thecodest.co\/","logo":{"@type":"ImageObject","inLanguage":"is","@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":"is","@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\/is\/author\/thecodest\/"}]}},"_links":{"self":[{"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/posts\/3427","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/comments?post=3427"}],"version-history":[{"count":8,"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/posts\/3427\/revisions"}],"predecessor-version":[{"id":7913,"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/posts\/3427\/revisions\/7913"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/media\/3428"}],"wp:attachment":[{"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/media?parent=3427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/categories?post=3427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/tags?post=3427"}],"curies":[{"name":"vp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}