{"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":"dowiedz-sie-wiecej-o-ruby-on-rails-z-pub-sub","status":"publish","type":"post","link":"https:\/\/thecodest.co\/pl\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/","title":{"rendered":"Wi\u0119cej informacji o Ruby on Rails z Pub\/Sub"},"content":{"rendered":"<p><strong><a href=\"https:\/\/thecodest.co\/pl\/case-studies\/providing-a-team-of-ruby-developers-for-a-fintech-company\/\">Ruby<\/a> na <a href=\"https:\/\/thecodest.co\/pl\/blog\/ways-to-increase-your-rails-performance\/\">Szyny<\/a><\/strong> (Rails, <a href=\"https:\/\/thecodest.co\/pl\/blog\/hire-ror-developer\/\">RoR<\/a>) jest dobrze znanym <a href=\"https:\/\/thecodest.co\/pl\/blog\/find-your-ideal-stack-for-web-development\/\">sie\u0107<\/a> framework aplikacji napisany w <strong>Ruby<\/strong> j\u0119zyk programowania. <strong>Pub\/Sub<\/strong> to kr\u00f3tka nazwa wzorc\u00f3w projektowych oprogramowania zwanych <b>Publikuj-subskrybuj<\/b>. Wyja\u015bni\u0119, w jaki spos\u00f3b komunikacja mi\u0119dzy komponentami oprogramowania w Railsach mo\u017ce by\u0107 obs\u0142ugiwana przez Pub\/Sub.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Co to jest Pub\/Sub?<\/h2>\n\n\n\n<p><strong>Pub\/sub<\/strong> to wzorzec projektowy oprogramowania zapewniaj\u0105cy komunikacj\u0119 mi\u0119dzy us\u0142ugami. Us\u0142uga<br>wi\u0105\u017ce si\u0119 z jedn\u0105 z dw\u00f3ch r\u00f3l: wydawcy (kt\u00f3ry produkuje) lub odbiorcy (kt\u00f3ry konsumuje). Co to jest<br>jest okre\u015blana jako zdarzenie, komunikat lub powiadomienie. W<br>W kontek\u015bcie tego artyku\u0142u s\u0105 one u\u017cywane zamiennie w odniesieniu do tej samej rzeczy.<br>Us\u0142uga, kt\u00f3ra produkuje, nie wie, kto konsumuje. Us\u0142uga, kt\u00f3ra konsumuje, nie<br>znaj\u0105 pochodzenie wiadomo\u015bci. Mog\u0105 pozosta\u0107 dla siebie nieznani. R\u00f3\u017cni si\u0119 to od<br>kolejki wiadomo\u015bci, w kt\u00f3rych komponent wysy\u0142aj\u0105cy wiadomo\u015b\u0107 cz\u0119sto zna jej miejsce docelowe<br>- Ten styl przesy\u0142ania wiadomo\u015bci pozwala na wysy\u0142anie ich w dowolne miejsce. Mechanizm ten jest podstaw\u0105<br>z <strong>Pub\/sub<\/strong> i oznacza to, \u017ce s\u0105 one od siebie oddzielone.<\/p>\n\n\n\n<p>Aby wyrazi\u0107 swoje wzajemne interesy, musz\u0105 mie\u0107 wsp\u00f3lne zrozumienie. Dlatego,<br>Obie role maj\u0105 ukryty mechanizm \"kija\", w kt\u00f3rym producent wiadomo\u015bci i u\u017cytkownik<br>konsument wiadomo\u015bci spotyka si\u0119. Mechanizm ten nazywany jest tematem, subskrypcj\u0105 lub tematem. Jest to<br>odpowiedzialny za kategoryzowanie wiadomo\u015bci do temat\u00f3w, jest zasadniczo bezstanowym filtrem wiadomo\u015bci.<br>Tematy dzia\u0142aj\u0105 jak stacje nadawcze. Wydawca wysy\u0142a wiadomo\u015b\u0107 do tematu,<br>subskrybenci natychmiast otrzymuj\u0105 wiadomo\u015b\u0107 z tematu. Ze wzgl\u0119du na roz\u0142\u0105czno\u015b\u0107<br>us\u0142ug, najbardziej efektywnym sposobem wymiany wiadomo\u015bci jest ich asynchroniczna obs\u0142uga.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Railsy bez Pub\/Sub<\/h2>\n\n\n\n<p>Domy\u015blnie Railsy nie maj\u0105 narzutu na wzorce projektowe oprogramowania do przekazywania komunikat\u00f3w mi\u0119dzy komponentami. Programi\u015bci u\u017cywaj\u0105 standardowych <strong>programowanie obiektowe<\/strong> (<a href=\"https:\/\/thecodest.co\/pl\/dictionary\/object-oriented-programming-oop\/\">OOP<\/a>): przekazywanie parametr\u00f3w do funkcji, pytanie klas o warto\u015bci.<\/p>\n\n\n\n<p>Gdy aplikacja jest raczej nieskomplikowana, mo\u017ce to wystarczy\u0107. Gdy aplikacja si\u0119 rozrasta, na przyk\u0142ad niekt\u00f3re operacje musz\u0105 by\u0107 wykonywane asynchronicznie, w\u00f3wczas nale\u017cy u\u017cy\u0107 funkcji <a href=\"https:\/\/thecodest.co\/pl\/dictionary\/why-do-projects-fail\/\">projekt<\/a> potrzebuje abstrakcji, kt\u00f3ra to rozwi\u0105zuje <a href=\"https:\/\/thecodest.co\/pl\/blog\/app-data-collection-security-risks-value-and-types-explored\/\">dane<\/a> przep\u0142yw pracy. Zamiast wymy\u015bla\u0107 ko\u0142o na nowo, deweloperzy mog\u0105 zaimplementowa\u0107 <strong>Pub\/sub<\/strong> aby wype\u0142ni\u0107 ten brak abstrakcji.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Zalety Pub\/Sub z Rails<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Unikaj wywo\u0142a\u0144 zwrotnych Active Record.<\/li>\n\n\n\n<li>Dodanie asynchronicznego przetwarzania r\u00f3wnoleg\u0142ego do systemu zwi\u0119ksza jego wydajno\u015b\u0107, niezawodno\u015b\u0107 i bezpiecze\u0144stwo. <a href=\"https:\/\/thecodest.co\/pl\/blog\/difference-between-elasticity-and-scalability-in-cloud-computing\/\">skalowalno\u015b\u0107<\/a> zosta\u0142y ulepszone.<\/li>\n\n\n\n<li>Wiadomo\u015bci mog\u0105 by\u0107 nadawane asynchronicznie do r\u00f3\u017cnych cz\u0119\u015bci systemu.<\/li>\n\n\n\n<li>Umo\u017cliwia asynchroniczn\u0105 emisj\u0119 wiadomo\u015bci do r\u00f3\u017cnych cz\u0119\u015bci systemu.<\/li>\n\n\n\n<li>Oddzielenie - dodanie lub zmiana funkcjonalno\u015bci nie wp\u0142ynie na nic, poniewa\u017c Pub\/Sub<br>pozwala modyfikowa\u0107 spos\u00f3b interakcji wszystkich element\u00f3w.<\/li>\n\n\n\n<li>Odbiorca wiadomo\u015bci nie b\u0119dzie ju\u017c musia\u0142 okresowo sprawdza\u0107 dost\u0119pno\u015bci aktualizacji lub nowych wiadomo\u015bci.<br>informacje. Zmniejsza to op\u00f3\u017anienia w dostarczaniu, kt\u00f3re mog\u0105 by\u0107 szczeg\u00f3lnie problematyczne w systemach<br>bez tolerancji dla op\u00f3\u017anie\u0144.<\/li>\n\n\n\n<li>Nie ma limitu liczby subskrybent\u00f3w, kt\u00f3rych system mo\u017ce obs\u0142u\u017cy\u0107, poniewa\u017c mo\u017ce si\u0119 on zmienia\u0107,<br>aktualizowa\u0107, mno\u017cy\u0107 lub znika\u0107 w dowolnym momencie.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Wady Pub\/Sub z Railsami<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>G\u0142\u00f3wn\u0105 wad\u0105 system\u00f3w Pub\/Sub jest ich roz\u0142\u0105czno\u015b\u0107 pomi\u0119dzy wydawc\u0105 i subskrybentem.<br>abonent.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Wprowadzenie Rails Pub\/Sub<\/h2>\n\n\n\n<p>Przyk\u0142ady \u017ar\u00f3de\u0142 w Railsach zosta\u0142y napisane przy u\u017cyciu biblioteki<br><a href=\"https:\/\/github.com\/stevo\/pubsub_on_rails\" rel=\"nofollow\">Pub\/Sub on Rails<\/a> (w nomenklaturze Rubiego biblioteka nazywana jest gemem): Wi\u0119cej szczeg\u00f3\u0142\u00f3w znajdziesz w readme gema. Implementacja sk\u0142ada si\u0119 z modu\u0142\u00f3w:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Domena,<\/li>\n\n\n\n<li>Wydarzenie,<\/li>\n\n\n\n<li>Obs\u0142uga zdarze\u0144,<\/li>\n\n\n\n<li>Wydawca wydarzenia,<\/li>\n\n\n\n<li>Subskrypcja.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Domena<\/h3>\n\n\n\n<p>Opisuje logik\u0119 biznesow\u0105 w celu zapewnienia kontekstu dla Pub\/Sub, a tym samym uczynienia go czystym. <a href=\"https:\/\/thecodest.co\/pl\/dictionary\/what-is-code-refactoring\/\">kod<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"> modu\u0142 Powiadomienia\n   extend PubSub::Domain\n koniec<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"> modu\u0142 Raporty\n   extend PubSub::Domain\n koniec\n\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Wydarzenie<\/h3>\n\n\n\n<p>Jest to klasa, kt\u00f3ra opisuje, co si\u0119 sta\u0142o. Zadeklaruj nazw\u0119 klasy jako samoopisuj\u0105c\u0105 si\u0119 z tym, co si\u0119 sta\u0142o, na przyk\u0142ad: anulowane, zmienione, utworzone, zniszczone, wys\u0142ane, zaktualizowane. Nazwy zdarze\u0144 mog\u0105 wygl\u0105da\u0107 nast\u0119puj\u0105co: ProfitAndLossStatementCreatedEvent, co oznacza, \u017ce zosta\u0142o utworzone sprawozdanie finansowe.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"> class Reports::ProfitAndLossStatementCreatedEvent &lt; PubSub::DomainEvent\n   atrybut :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\">Wydawca wydarzenia<\/h3>\n\n\n\n<p>Klasa zdolna do emitowania zdarze\u0144. Przyk\u0142ad pokazuje tworzenie raportu us\u0142ugi. Po pomy\u015blnym utworzeniu raportu emitowane jest zdarzenie utworzenia tego raportu.<\/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\">Obs\u0142uga zdarze\u0144<\/h3>\n\n\n\n<p>Klasa ta powinna by\u0107 wykonywana w odpowiedzi na obs\u0142ug\u0119 zdarzenia.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">modu\u0142 Powiadomienia\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\">Subskrypcja<\/h3>\n\n\n\n<p>Zdarzenia s\u0105 powi\u0105zane ze swoimi programami obs\u0142ugi poprzez subskrypcje.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">powiadomienia:\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\">Przyk\u0142adowe przypadki u\u017cycia:<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Funkcja \"\u015aled\u017a\" w sieciach spo\u0142eczno\u015bciowych,<\/li>\n\n\n\n<li>Internet rzeczy,<\/li>\n\n\n\n<li>Mailing,<\/li>\n\n\n\n<li>Powiadomienie o wygenerowanych plikach.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Podobne wzorce<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><b>EventBus<\/b> - Komponenty mog\u0105 wysy\u0142a\u0107 zdarzenia do EventBus, nie wiedz\u0105c, kto je odbierze ani ilu respondent\u00f3w je odbierze. <a href=\"https:\/\/thecodest.co\/pl\/blog\/react-development-all-you-have-to-know\/\">reagowa\u0107<\/a>,<\/li>\n\n\n\n<li><b>Obserwator<\/b> - podmiot utrzymuje list\u0119 podmiot\u00f3w zale\u017cnych, zwanych obserwatorami, i powiadamia ich za ka\u017cdym razem, gdy zmienia si\u0119 ich stan,<\/li>\n\n\n\n<li><b>\u0141\u0105czenie<\/b> - Podczas odpytywania klienci okresowo pytaj\u0105 system, czy s\u0105 jakie\u015b nowe zdarzenia lub dane.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Klejnoty<\/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>na<\/em>szyny<\/a><\/p>\n<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Podsumowanie<\/h2>\n\n\n\n<p>Pub\/sub nie jest powszechnym podej\u015bciem w Ruby in Rails. Jak przedstawiono w artykule, wzorzec ten mo\u017ce przynie\u015b\u0107 wiele korzy\u015bci dla projektu - mo\u017ce uczyni\u0107 kod czystym, oddzieli\u0107 us\u0142ugi i uczyni\u0107 je \u0142atwo skalowalnymi.<\/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=\"baner wsp\u00f3\u0142pracy\"\/><\/a><\/figure>","protected":false},"excerpt":{"rendered":"<p>Pub\/Sub mo\u017ce przynie\u015b\u0107 wiele korzy\u015bci dla projektu - mo\u017ce sprawi\u0107, \u017ce kod b\u0119dzie czysty, oddzieli\u0107 us\u0142ugi i uczyni\u0107 je \u0142atwo skalowalnymi. Dowiedz si\u0119 wi\u0119cej o Pub\/Sub w poni\u017cszym artykule i podnie\u015b poziom swojego projektu!<\/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\/pl\/blog\/dowiedz-sie-wiecej-o-ruby-on-rails-z-pub-sub\/\" \/>\n<meta property=\"og:locale\" content=\"pl_PL\" \/>\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\/pl\/blog\/dowiedz-sie-wiecej-o-ruby-on-rails-z-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 minuty\" \/>\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\":\"pl-PL\",\"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\":\"pl-PL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/learn-more-about-ruby-on-rails-with-pub-sub\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pl-PL\",\"@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\":\"pl-PL\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\",\"name\":\"The Codest\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pl-PL\",\"@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\":\"pl-PL\",\"@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\\\/pl\\\/author\\\/thecodest\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Dowiedz si\u0119 wi\u0119cej o Ruby on Rails z Pub\/Sub - The Codest","description":"Poznaj wzorzec projektowy Pub\/Sub w Ruby on Rails i zobacz, jak umo\u017cliwia on komunikacj\u0119 sterowan\u0105 zdarzeniami i skalowaln\u0105 architektur\u0119 systemu.","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\/pl\/blog\/dowiedz-sie-wiecej-o-ruby-on-rails-z-pub-sub\/","og_locale":"pl_PL","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\/pl\/blog\/dowiedz-sie-wiecej-o-ruby-on-rails-z-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 minuty"},"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":"pl-PL","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":"Dowiedz si\u0119 wi\u0119cej o Ruby on Rails z 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":"Poznaj wzorzec projektowy Pub\/Sub w Ruby on Rails i zobacz, jak umo\u017cliwia on komunikacj\u0119 sterowan\u0105 zdarzeniami i skalowaln\u0105 architektur\u0119 systemu.","breadcrumb":{"@id":"https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/#breadcrumb"},"inLanguage":"pl-PL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thecodest.co\/blog\/learn-more-about-ruby-on-rails-with-pub-sub\/"]}]},{"@type":"ImageObject","inLanguage":"pl-PL","@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":"pl-PL"},{"@type":"Organization","@id":"https:\/\/thecodest.co\/#organization","name":"The Codest","url":"https:\/\/thecodest.co\/","logo":{"@type":"ImageObject","inLanguage":"pl-PL","@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":"pl-PL","@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\/pl\/author\/thecodest\/"}]}},"_links":{"self":[{"href":"https:\/\/thecodest.co\/pl\/wp-json\/wp\/v2\/posts\/3427","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecodest.co\/pl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecodest.co\/pl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecodest.co\/pl\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thecodest.co\/pl\/wp-json\/wp\/v2\/comments?post=3427"}],"version-history":[{"count":8,"href":"https:\/\/thecodest.co\/pl\/wp-json\/wp\/v2\/posts\/3427\/revisions"}],"predecessor-version":[{"id":7913,"href":"https:\/\/thecodest.co\/pl\/wp-json\/wp\/v2\/posts\/3427\/revisions\/7913"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecodest.co\/pl\/wp-json\/wp\/v2\/media\/3428"}],"wp:attachment":[{"href":"https:\/\/thecodest.co\/pl\/wp-json\/wp\/v2\/media?parent=3427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecodest.co\/pl\/wp-json\/wp\/v2\/categories?post=3427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecodest.co\/pl\/wp-json\/wp\/v2\/tags?post=3427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}