call_end

    • chevron_right

      JMP: JMP is Launched and Out of Beta

      news.movim.eu / PlanetJabber • 12 June, 2023 • 2 minutes

    JMP has been in beta for over six years, and today we are finally launching! With feedback and testing from thousands of users, our team has made improvements to billing, phone network compatibility, and also helped develop the Cheogram Android app which provides a smooth onboarding process, good Android integration, and phone-like UX for users of that platform. There is still a long road ahead of us, but with so much behind us we’re comfortable saying JMP is ready for launch, and that we know we can continue to work with our customers and our community for even better things in the future. Check out our launch on Product Hunt today as well!

    JMP’s pricing has always been “while in beta” so the first question this raises for many is: what will the price be now? The new monthly price for a customer’s first JMP phone number is now $4.99 USD / month ($6.59 CAD), but we are running a sale so that all customers will continue to pay beta pricing of $2.99 USD / month ($3.59 CAD) until the end of August . We are extending until that time the option for anyone who wishes to prepay for up to 3 years and lock-in beta pricing . Contact support if you are interested in the prepay option. After August, all accounts who have not pre-paid will be put on the new plan with the new pricing. Those who do pre-pay won’t see their price increase until the end of the period they pre-paid for.  The new plan will also include a multi-line discount, so second, third, etc JMP phone numbers will be $2.45 USD / month ($3.45 CAD) when they are set to all bill from the same balance.  The new plan will also finally have zero-rated toll free calling.  All other costs (per-minute costs, etc) remain the same, see the pricing page for details.

    The account settings bot now has an option “Create a new phone number linked to this balance” so that you can get new numbers using your existing account credit and linked for billing to the same balance without support intervention.

    Thanks so much to all of you who have helped us get this far.  There is lots more exciting stuff coming this year, and we are so thankful to have such a supportive community along the way with us.  Don’t forget we’ll be at FOSSY in July , and be sure to check out our launch on Product Hunt today as well.

    • wifi_tethering open_in_new

      This post is public

      blog.jmp.chat /b/launch-2023

    • chevron_right

      Erlang Solutions: Sign up for the RabbitMQ Summit Waiting List

      news.movim.eu / PlanetJabber • 12 June, 2023 • 1 minute

    Mark your calendars! The Very Early Bird tickets for the RabbitMQ Summit are set to open on 15th June, 2023. In joining the waiting list, you will receive exclusive access to the conference’s best-priced tickets.

    This is your chance to secure your spot at the RabbitMQ Summit at a discounted rate, allowing you to make the most of this incredible learning and networking opportunity.

    Event date and location

    Join us on 20th Oct 2023 at the Estrel Hotel- Berlin in Germany.

    About the RabbitMQ Summit

    The RabbitMQ Summit 2023 is an eagerly anticipated event that brings together software developers, system architects, and industry experts from around the world.

    RabbitMQ is utilised by more than 35,000 companies globally and is considered a top choice for implementing the Advanced Message Queuing Protocol (AMQP).

    By joining us, you’ll have the opportunity to learn from industry experts, who will provide valuable insights and share best practices for successfully integrating RabbitMQ into your organisation.

    We’re looking forward to creative talks, great vibes and most importantly, meeting fellow Rabbit MQ enthusiasts!

    Ticket details

    You can join the waitlist and sign up for exclusive access here .

    For more information

    You can visit the RabbitMQ Summit website for more details and follow our Twitter account for the latest updates.

    The post Sign up for the RabbitMQ Summit Waiting List appeared first on Erlang Solutions .

    • wifi_tethering open_in_new

      This post is public

      www.erlang-solutions.com /blog/sign-up-for-the-rabbitmq-summit-waiting-list/

    • chevron_right

      Erlang Solutions: Call for Speakers at the RabbitMQ Summit

      news.movim.eu / PlanetJabber • 8 June, 2023 • 1 minute

    Are you a user, operator, developer, engineer, or simply someone with interesting user stories to tell about RabbitMQ? If so, we have some exciting news for you! The RabbitMQ Summit 2023 is just around the corner, and we are thrilled to invite you to submit your talks for this highly anticipated event.

    The RabbitMQ Summit brings together a vibrant, diverse community of enthusiasts from all corners of the world. It’s a unique opportunity to connect, learn, and exchange ideas with fellow RabbitMQ users, experts, and developers.

    This year, we have curated two exciting themes that encompass the breadth and depth of RabbitMQ usage and its impact across industries. We invite you to consider these themes when submitting your proposals:

    1. Features Theme-  in-depth tech explanation of RabbitMQ features, e.g.: How to use RabbitMQ in an economical fashion explained by developers, a roadmap of how to use streams.

    2. Industry Theme-  how RabbitMQ is used in the industry, e.g.: In an IoT space, troubleshooting, etc.

    Think creatively and propose talks that bring unique perspectives, cutting-edge techniques, and actionable insights to the table. Don’t hesitate to submit your ideas – every story counts.

    Event date and location

    20 Oct 2023 at the Estrel Hotel- Berlin, Germany

    Submission deadlines

    All talks should be submitted by 23:59 BST on 11 June 2023 . You will be informed about your submission status by 31 July 2023 .

    You can submit your talks here .

    Ticket Details

    There is no event fee for speakers. For just attendees, The public Early Bird tickets will be available on 15th June 2023. You can sign up for the waiting list here

    For more information

    You can visit the RabbitMQ Summit website for more details and follow our Twitter account for the latest updates.

    The post Call for Speakers at the RabbitMQ Summit appeared first on Erlang Solutions .

    • wifi_tethering open_in_new

      This post is public

      www.erlang-solutions.com /blog/call-for-speakers-at-the-rabbitmq-summit/

    • chevron_right

      Erlang Solutions: How ChatGPT improved my Elixir code. Some hacks are included.

      news.movim.eu / PlanetJabber • 1 June, 2023 • 3 minutes

    I have been working as an Elixir developer for quite some time and recently came across the ChatGPT model. I want to share some of my experience interacting with it.

    During my leisure hours, I am developing an open-source Elixir initiative, Crawly , that facilitates the extraction of structured data from the internet.

    Here I want to demonstrate how ChatBot helped me to improve the code. Let me show you some prompts I have made and some outputs I’ve got back.

    Writing documentation for the function

    I like documentation! It’s so nice when the code you’re working with is documented! What I don’t like — is writing it. It’s hard, and it’s even harder to keep it updated.

    So let’s consider the following example from our codebase:

    My prompt:

    Reasonably good for my taste. Here how it looks like after a few clarifications:

    Improving my functions

    Let’s look at other examples of the code I have created! Here is an example of code I am not super proud of. Please don’t throw stones at me; I know I should not create atoms dynamically. Well, you know how it can be- you want to have something, but you don’t have enough time with idea to improve things later and that later never happens. I think every human developer knows that story.

    Suggesting tests for the code

    Writing tests is a must-have in the modern world. TDD makes software development better. As a human, I like to have tests. However, I find it challenging to write them. Can we use the machine to do that? Let’s see!

    Regarding tests, the response code needs to be more accurate. It might be possible to improve results by feeding chatBot with Elixir test examples, but these tests are good as hints.

    Creating Swagger documentation from JSON Schema

    I like using JSON schema for validating HTTP requests. The question is — is that possible to convert a given JSON schema into a Swagger description so we don’t have to do double work?

    Let’s see. Fortunately, I have a bit of JSON schema-type data in Crawly. Let’s see if we can convert it into Swagger.

    Well, it turns out it’s not a full Swagger format; which is a bit of a shame. Can we improve it a bit so it can be used immediately? Yes, let’s prompt engineer it a bit:

    Now I can preview the result in the real Swagger editor, and I think I like it:

    Conclusion

    What can I say? ChatGPT is a perfect assistant that makes development way less boring for regular people.

    Using ChatGPT when programming with Elixir can bring several advantages. One of the most significant advantages is that it can provide quick and accurate responses to various programming queries, including syntax and documentation. This can help programmers save time and improve their productivity.

    Additionally, ChatGPT can offer personalised and adaptive learning experiences based on individual programmers’ skill levels and preferences. This can help programmers learn Elixir more efficiently and effectively.

    The use of AI and NLP in programming is likely to become more widespread in the near future. As AI technology continues to improve, it may become more integrated into the programming process, helping programmers to automate repetitive tasks and improve their overall productivity. ChatGPT is just one example of how AI is already being used to improve the programming experience, and more innovations in this field will likely emerge in the future.

    Honestly, I am super excited and would love to explore the possibilities of AI even further!

    The post How ChatGPT improved my Elixir code. Some hacks are included. appeared first on Erlang Solutions .

    • wifi_tethering open_in_new

      This post is public

      www.erlang-solutions.com /blog/how-chatgpt-improved-my-elixir-code-some-hacks-are-included/

    • chevron_right

      Erlang Solutions: Here’s why you should consider investing in RabbitMQ during a recession

      news.movim.eu / PlanetJabber • 25 May, 2023 • 6 minutes

    Europe and the US are leading the way in the forecasted recession for 2023, due to persistently high inflation and increasing interest rates. With minimal projected GDP growth, modern technologies can play a crucial role in reducing the impact of economic downturns.

    As caution looms, it can be tempting to reign in on your investment. Your initial thought is to balance the books and save money where you can which, on the surface, sounds like the sensible thing to do.

    But consider this. Investing in technology, specifically RabbitMQ in the face of recession can actually reduce the cost of doing business and save you money over time. In fact, leading digital organisations that have prioritised this has a lower cost of doing business and create a significant competitive edge in the current inflationary environment.

    Carving out a tech budget can signify that you’re conscious of the current challenges while being hopeful for the future. Being mindful of the long game can allow businesses to thrive as well as survive.

    So if you really want to recession-proof your business? We’ll tell you why it’s best to invest.

    Executives are already planning tech investments

    In a survey complied by Qualtrics, a majority of C-suite level executives (85%) expect spending to increase this year, as their companies go through both a workforce and digital transformation, with tech priorities as follows:

    1. Tech modernisation (73%)
    2. Cybersecurity (73%)
    3. Staffing/retaining workforce (72%)
    4. Training/reskilling workforce (70%)
    5. Remote work support (70%)

    This is a major shift from previous cycles we’ve seen. In the past, tech investments have been one of the first on the chopping block. But now, businesses have taken note that investing in technology is not a cost, but a business driver and differentiator.

    The game of business survival has changed

    Prior to the pandemic in 2020, digital capabilities were not considered a high priority by businesses when considering preparations for a potential economic downturn. Fast forward to today, and we can see that COVID-19 has expedited digital change for businesses.

    Companies have accelerated the digitisation of customer and supply-chain interactions by three to four years, and a sudden change in consumer habits has steered the ship.

    Consumers made a drastic shift towards online channels, which meant that industries had to ramp up their digital offerings fast. Rates of adoption during this time were lightyears of ahead when compared to previous years (as shown above).
    Fast forward to today and 48% of consumers say their buying habits have permanently changed since the pandemic. Businesses have to maintain their digital presence, in order to serve a growing market.

    Adapting to demand

    Technologies such as RabbitMQ have been integral to support the high volume of incoming requests and efficiently accommodate digital acceleration.

    Consider this- your website might be selling tickets to an event, and you’re anticipating a record number of visitors. Your main consideration is ensuring your satisfying customer wait times. So what’s the solution? A faster operating system.

    RabbitMQ technology helps with customer wait times through its ability to handle high volumes of incoming requests. These requests are distributed to various parts of the system, ensuring that each one is processed promptly. By effectively handling the increased load, RabbitMQ helps businesses maintain shorter wait times, accommodating increased or decreased message volumes with ease, as business demands fluctuate during a recession.

    Sustainability is steering the tech agenda

    Do you think businesses are slowing down on ESG during a recession? Think again.

    A recent study revealed nearly half of CFOs plan to increase investment in ESG initiatives this year despite high inflation, ongoing supply chain challenges and the risk of recession.

    According to the World Economic Forum, 90% of executives believe sustainability is important. However, only 60% of organisations have sustainability strategies.

    Addressing ESG initiatives during a recession requires a thoughtful approach from C-Suite leaders and should be apparent across your tech offerings. While not all software is inherently sustainable, tools like RabbitMQ can support sustainable practices.

    For example, organisations can further enhance the sustainability of their messaging infrastructure by running RabbitMQ on energy-efficient hardware, leveraging cloud services with renewable energy commitments, or optimising their message routing algorithms to minimise resource usage. These additional considerations can contribute to a more sustainable use of RabbitMQ as part of a broader sustainability framework within a business.

    Providing professional, reliable, and cutting-edge products and services with ESG values can bring meaningful change to people’s lives. And building social responsibility is critical to support the entire ecosystem.

    Tech built for business operations

    IT was once run by very centralised systems. But today, most software used by businesses is outsourced- meaning all the services are disjointed and require training to understand how to manage each one individually, which can be costly.

    SOA stands for Service-Oriented Architecture. In relation to RabbitMQ, SOA refers to a design approach where software applications are built as a collection of individual services that communicate with each other to perform specific tasks. RabbitMQ can play a role in facilitating communication between these services.

    An_Empirical_Analysis_on_the_Microservices_Architecture_Pattern_and_Service-Oriented_Architecture

    Imagine your company’s different departments- sales, inventory, shipping, HR etc. Each department has its own software application that handles specific tasks. In a traditional architecture, these applications might be tightly coupled, meaning they directly interact with each other.

    With a service-oriented architecture, the applications are designed as separate services. Each service focuses on a specific function, like processing sales orders, managing inventory, or tracking shipments. These services can communicate with each other by sending messages.

    RabbitMQ acts as a messenger between these services. When one service needs to send information or request something from another service, it can publish a message to RabbitMQ. The receiving service listens and responds accordingly. This decoupled approach allows services to interact without having direct knowledge of each other, promoting flexibility and scalability.

    For example, when a sales application receives a new order, it can publish a message to RabbitMQ containing the order details. The inventory service, subscribed to the relevant message queue, receives the order information, updates the inventory, and sends a confirmation back through RabbitMQ. The shipping service can then listen for shipping requests and initiate the shipping process.

    During a recession, SOA with RabbitMQ enables a more modular and flexible system, where services can be developed, deployed, and scaled independently. It simplifies communication between different components, promotes loose coupling, and allows for efficient integration and the ability to quickly adapt to changing market conditions of a recession.

    Tech supports recession-proofing goals

    Investment in innovative digital initiatives is indispensable for a constantly evolving digital transformation journey, especially during market shifts. Programmes such as RabbitMQ provide organisations with the flexibility required to swiftly shift to new solutions, responding to market changes more quickly.

    To conclude, although recessions can be intimidating, it is crucial for businesses to embrace technology as a means to prepare themselves and ensure a positive customer experience. Leveraging technological solutions allows businesses to stay resilient, adapt to changing market dynamics, and position themselves for long-term success, even in challenging economic times.

    If you’d like to talk about your current tech space, feel free to drop us a line .

    The post Here’s why you should consider investing in RabbitMQ during a recession appeared first on Erlang Solutions .

    • wifi_tethering open_in_new

      This post is public

      www.erlang-solutions.com /blog/heres-why-you-should-consider-investing-in-rabbitmq-during-a-recession/

    • chevron_right

      Ignite Realtime Blog: CVE-2023-32315: Openfire Administration Console authentication bypass

      news.movim.eu / PlanetJabber • 23 May, 2023

    We’ve had an important security issue reported that affects all recent versions of Openfire. We’ve fixed it in the newly published 4.6.8 and 4.7.5 releases. We recommend people upgrade as soon as possible. More info, including mitigations for those who cannot upgrade quickly, is available in this security advisory: CVE-2023-32315: Administration Console authentication bypass .

    Related to this issue, we have also made available updates to three of our plugins:

    If you’re using these plugins, it is recommended to update them immediately.

    When you are using the REST API plugin, or any proprietary plugins, updating Openfire might affect availability of their functionality. Please find work-arounds in the security advisory .

    If you have any questions, please stop by our community forum or our live groupchat .

    For other release announcements and news follow us on Twitter and Mastodon .

    1 post - 1 participant

    Read full topic

    • wifi_tethering open_in_new

      This post is public

      discourse.igniterealtime.org /t/cve-2023-32315-openfire-administration-console-authentication-bypass/92869

    • chevron_right

      Ignite Realtime Blog: Openfire 4.7.5 Release

      news.movim.eu / PlanetJabber • 23 May, 2023

    The Ignite Realtime Community is happy to announce the 4.7.5 release of Openfire!

    This release primarily addresses the issue that is subject of security advisory CVE-2023-32315 , but also pulls in a number of improvements and bugfixes

    You can find download artifacts available here with the following sha256sum values

    f70faf11b4798fefb26a20f7d60288d275a6d568db78faf79a4194cbae72eab4  openfire-4.7.5-1.noarch.rpm
    d1283d417dacb74d67334c06420679aae62d088bd3439c8135ccfc272fd5b95b  openfire_4.7.5_all.deb
    60d8efb96a1891cda2deac2cda9808cf6adec259f090d3a7fb2b7ca21484d75b  openfire_4_7_5.exe
    98d36c2318706c545345274234e2f5ccbf0f72f7801133effea342e2776b8bb0  openfire_4_7_5.tar.gz
    e95348be890aff64a7447295ab18eebb29db4bdc346b802df0c878ebbbf1d18e  openfire_4_7_5_x64.exe
    a5bb8c9b944b915bdf7ecf92cd2a689d0cf09e88bfc2df960f38000f6b788194  openfire_4_7_5.zip
    

    If you have any questions, please stop by our community forum or our live groupchat . We are always looking for volunteers interested in helping out with Openfire development!

    For other release announcements and news follow us on Twitter and Mastodon .

    1 post - 1 participant

    Read full topic

    • chevron_right

      Ignite Realtime Blog: Openfire 4.6.8 Release

      news.movim.eu / PlanetJabber • 23 May, 2023 • 2 minutes

    The Ignite Realtime Community is happy to announce the 4.6.8 release of Openfire!

    We have made available a new release of this older version to addresses the issue that is subject of security advisory CVE-2023-32315 .

    We are aware that for some, the process of deploying a new major version of Openfire is not a trivial matter, as it may encompass a lot more than only performing the update of the executables. Depending on regulations that are in place, this process can require a lot of effort and take a long time to complete. To facilitate users that currently use an older version of Openfire, we are also making available this new release in the older 4.6 branch of Openfire. An upgrade to this version will, for some, require a lot less effort. Note well: although we are making available a new version in the 4.6 branch of Openfire, we strongly recommend that you upgrade to the latest version of Openfire (currently in the 4.7 branch), as that includes important fixes and improvements that are not available in 4.6.

    You can find download artifacts available here with the following sha256sum values

    aa1947097895a6d41bc8d1ac29f6ea60507bce69caadc497b4794a2a4110dc20  openfire-4.6.8-1.i686.rpm
    346871c71eff8e3b085fecd2f8dce5bfbf387885cfa7aff2076d42bd7273f70b  openfire-4.6.8-1.noarch.rpm
    37e4cc510cc2a59de50288c0e3baa53dcc702631433a01873a9270eeb7c789db  openfire-4.6.8-1.x86_64.rpm
    e92c5a0b76da5964b2e3fa43686ad63db29ef891ec7266ab16fe3a93b06c9e01  openfire_4.6.8_all.deb
    c6e0e40c55a81276881e93469ce88a862226ce33e58c8811e760427b878ebed4  openfire_4_6_8_bundledJRE.exe
    1b4c209453fffb6a6310354b425995bb92c1f09944eed35a1fd61a30201355bc  openfire_4_6_8_bundledJRE_x64.exe
    6b19394dc3f275ca039f85af59ca4f2fc5f628e2505cb39e59f5cfa55d605788  openfire_4_6_8.exe
    b22fce993bce4930346183d5edc1e9e38827a47ed8f64c41486a105f574cc116  openfire_4_6_8.tar.gz
    7c5769c7c8869ce2dfbb93fbbf1ec97a4e8509d61f8c14ba3f6be20abd05e90e  openfire_4_6_8_x64.exe
    72f27d063446479e1d4ceb2a46ac838f5462dfca53032cfa068eb96ef08d0697  openfire_4_6_8.zip
    

    If you have any questions, please stop by our community forum or our live groupchat . We are always looking for volunteers interested in helping out with Openfire development!

    For other release announcements and news follow us on Twitter and Mastodon .

    1 post - 1 participant

    Read full topic

    • chevron_right

      Erlang Solutions: Entendiendo procesos y concurrencia

      news.movim.eu / PlanetJabber • 18 May, 2023 • 8 minutes

    Bienvenidos al segundo capítulo de la serie “ Elixir, 7 pasos para iniciar tu viaje” .

    En el primer capítulo hablamos sobre la máquina virtual de Erlang, la BEAM, y las características que Elixir aprovecha de ella para desarrollar sistemas que son:

    • Concurrentes
    • Tolerantes a fallos
    • Escalables y
    • Distribuidos

    En esta nota explicaremos qué significa la concurrencia para Elixir y Erlang y por qué es importante para desarrollar sistemas tolerantes a fallos. Al final encontrarás un pequeño ejemplo de código hecho con Elixir para que puedas observar las ventajas de la concurrencia en acción.

    Concurrencia

    La concurrencia es la habilidad para llevar a cabo dos o más tareas

    aparentemente al mismo tiempo .

    Para entender por qué la palabra aparentemente está resaltada, veamos el siguiente caso:

    Una persona tiene que completar dos actividades, la tarea A y la tarea B

    • Inicia la tarea A, avanza un poco y la pausa.
    • Inicia la tarea B, avanza un poco, la pausa y continúa con la tarea A.
    • Avanza un poco con la tarea A, la pausa y continúa con la tarea B.

    Y así va avanzando con cada una, hasta terminar ambas actividades.

    No es que la tarea A y la tarea B se lleven a cabo exactamente al mismo tiempo, más bien la persona dedica un tiempo a cada una y va intercambiándose entre ellas. Estos tiempos pueden ser tan cortos que el cambio es imperceptible para nosotros, por eso se produce la ilusión de que las actividades están sucediendo simultáneamente.

    Paralelismo

    Hasta ahora no había mencionado nada sobre paralelismo porque no es un concepto fundamental en la BEAM o para Elixir. Pero recuerdo que cuando estaba aprendiendo a programar se me dificultó comprender la diferencia entre paralelismo y concurrencia, así que aprovecharé esta nota para compartirte una breve explicación.

    Sigamos con el ejemplo anterior. Si ahora traemos a otra persona para completar las tareas y ambas trabajan al mismo tiempo, hablamos de paralelismo .

    De manera que podríamos tener a dos o más personas trabajando paralelamente, cada una llevando a cabo sus actividades concurrentemente. Es decir, la concurrencia puede ser o no paralela.

    En Elixir la concurrencia se logra gracias a los procesos de Erlang, que son creados y administrados por la BEAM.

    Procesos

    En Elixir todo el código se ejecuta dentro de procesos. Y una aplicación puede tener cientos o miles de ellos ejecutándose de manera concurrente.

    ¿Cómo funciona?

    Cuando la BEAM se ejecuta en una máquina, se encarga de crear por default un hilo en cada procesador disponible. En ese hilo existe una cola dedicada a tareas específicas, y cada cola tiene a su vez un administrador ( scheduler ) que es responsable de asignar un tiempo y una prioridad a las tareas.

    Entonces, en una máquina multicore con dos procesadores puedes tener dos hilos y dos schedulers , lo que te permite paralelizar las tareas al máximo. También puedes ajustar la configuración de la BEAM para indicarle qué procesadores utilizar.

    En cuanto a las tareas, cada una se ejecuta en un proceso aislado.

    Parece algo simple, pero justamente esta idea es la magia detrás de la escalabilidad, distribución y tolerancia a fallos de un sistema hecho con Elixir.

    Veamos este último concepto para entender por qué.

    Tolerancia a fallos

    La tolerancia a fallos de un sistema se refiere a la capacidad que tiene para manejar los errores y no morir en el intento. El objetivo es que ninguna falla, sin importar lo crítica que sea, inhabilite o bloquee el sistema. Esto se logra nuevamente gracias a los procesos de Erlang.

    Los procesos son elementos aislados, que no comparten memoria y se comunican mediante paso de mensajes.

    Lo anterior significa que si algo falla en el proceso A, el proceso B no se ve afectado, es más, es posible que ni siquiera se entere. El sistema seguirá funcionando con normalidad mientras la falla se arregla tras bambalinas . Y si a esto sumamos que la BEAM también nos proporciona por defecto mecanismos para detección y recuperación de errores podemos garantizar que el sistema funcione de manera ininterrumpida.

    Si quieres explorar más acerca del funcionamiento de los procesos, puedes consultar esta nota: Understanding Processes for Elixir Developers .

    ¿Cómo se ve esto en Elixir?

    ¡Por fin llegamos al código!

    Revisemos un ejemplo de cómo crear procesos que se ejecutan de manera concurrente en Elixir. Lo vamos a contrastar con el mismo ejercicio ejecutándose de manera secuencial.

    ¿Listo? No te preocupes si no entiendes algo de la sintaxis, en general el lenguaje es muy intuitivo, pero el objetivo por ahora es que seas testigo de la magia de la concurrencia en acción.

    El primer paso consiste en crear los procesos.

    Spawn

    Hay diferentes formas de crear procesos en Elixir. A medida que vayas avanzando encontrarás maneras más sofisticadas de hacerlo, aquí utilizaremos la básica: la función spawn . ¡Manos a la obra!

    Tenemos 10 registros que corresponden a la información de usuarios que vamos a insertar en una base de datos, pero antes queremos validar que el nombre no contenga caracteres raros y que el email tenga un @.

    Supongamos que la validación de cada usuario tarda en total 2 segundos.

    1. Abre un editor de texto y copia el siguiente código. Guárdalo en un archivo llamado procesos.ex
    defmodule Procesos do
    
    
     # Vamos a utilizar expresiones regulares para el formato del nombre y
     # el correo electrónico
     @email_valido ~r/^([a-zA-Z0-9_\-\.\+]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$/
     @nombre_valido ~r/\b([A-ZÀ-ÿ][-,a-z. ']+[ ]*)+/
    
    
     # Se tiene una lista de usuarios con un nombre y correo electrónico. 
     # La función validar_usuarios_X manda a llamar a otra función: 
     # validar_usuario, que revisa el formato del correo e imprime un
     # mensaje de ok o error para cada registro
    
    
     # Esta función trabaja SECUENCIALMENTE
     def validar_usuarios_secuencialmente() do
       IO.puts("Validando usuarios secuencialmente...")
    
    
       usuarios = crear_usuarios()
    
    
       Enum.each(usuarios, fn elem -> 
         validar_usuario(elem) end)
    end
    
    
     # Esta función trabaja CONCURRENTEMENTE, utilizando spawn
     def validar_usuarios_concurrentemente() do
       IO.puts("Validando usuarios concurrentemente...")
    
    
       usuarios = crear_usuarios()
    
    
       Enum.each(usuarios, fn elem ->
         spawn(fn -> validar_usuario(elem) end)
       end)
     end
    
    
     def validar_usuario(usuario) do
       usuario
       |> validar_email()
       |> validar_nombre()
       |> imprimir_estatus()
    
    
    # Esto hace una pausa de 2 segundos para simular que el proceso inserta # los registros en base de datos
       Process.sleep(2000)
     end
    
    
     # Esta función recibe un usuario, valida el formato del correo y le 
     # agrega la llave email_valido con el resultado.
    def validar_email(usuario) do
       if Regex.match?(@email_valido, usuario.email) do
         Map.put(usuario, :email_valido, true)
       else
         Map.put(usuario, :email_valido, false)
       end
     end
    
    
     # Esta función recibe un usuario, valida su nombre y le agrega la
     # llave nombre_valido con el resultado.
     def validar_nombre(usuario) do
       if Regex.match?(@nombre_valido, usuario.nombre) do
         Map.put(usuario, :nombre_valido, true)
       else
         Map.put(usuario, :nombre_valido, false)
       end
     end
    # Esta función recibe un usuario que ya pasó por la validación
     # de email y nombre y dependiendo de su resultado, imprime el
     # mensaje correspondiente al estatus.
     def imprimir_estatus(%{
           id: id,
           nombre: nombre,
           email: email,
           email_valido: email_valido,
           nombre_valido: nombre_valido
         }) do
       cond do
         email_valido && nombre_valido ->
           IO.puts("Usuario #{id} | #{nombre} | #{email} ... es válido")
    
    
         email_valido && !nombre_valido ->
           IO.puts("Usuario #{id} | #{nombre} | #{email} ... tiene un nombre inválido")
    
    
         !email_valido && nombre_valido ->
           IO.puts("Usuario #{id} | #{nombre} | #{email} ... tiene un email inválido")
    
    
         !email_valido && !nombre_valido ->
           IO.puts("Usuario #{id} | #{nombre} | #{email} ... es inválido")
       end
     end
    
    
     defp crear_usuarios do
       [
         %{id: 1, nombre: "Melanie C.", email: "melaniec@test.com"},
         %{id: 2, nombre: "Victoria Beckham", email: "victoriab@testcom"},
         %{id: 3, nombre: "Geri Halliwell", email: "gerih@test.com"},
         %{id: 4, nombre: "123456788", email: "melb@test.com"},
         %{id: 5, nombre: "Emma Bunton", email: "emmab@test.com"},
         %{id: 6, nombre: "Nick Carter", email: "nickc@test.com"},
         %{id: 7, nombre: "Howie Dorough", email: "howie.dorough"},
         %{id: 8, nombre: "", email: "ajmclean@test.com"},
         %{id: 9, nombre: "341AN L1ttr377", email: "Brian-Littrell"},
         %{id: 10, nombre: "Kevin Richardson", email: "kevinr@test.com"}
       ]
     end
    end
    

    2. Abre una terminal, escribe iex y compila el archivo que acabamos de crear.

    $ iex
    
    
    Erlang/OTP 25 [erts-13.1.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
    
    
    Interactive Elixir (1.14.0) - press Ctrl+C to exit (type h() ENTER for help)
    iex(1)> c("procesos.ex")
    [Procesos]

    3. Una vez que hayas hecho esto, manda a llamar la función que valida los registros secuencialmente. Tomará un poco de tiempo, ya que cada registro tarda 2 segundos.

    
    iex(2)>  Procesos.validar_usuarios_secuencialmente

    4. Ahora manda a llamar la función que valida los registros concurrentemente y observa la diferencia en tiempos.

    iex(3)>  Procesos.validar_usuarios_concurrentemente

    Es bastante notoria, ¿no crees? Esto se debe a que en el paso 3, con la evaluación secuencial, cada proceso tiene que esperar a que el anterior termine. En cambio, la ejecución concurrente crea procesos que funcionan aisladamente; por lo tanto, ninguno depende del anterior ni está bloqueado por ninguna otra tarea.

    ¡Imagina la diferencia cuando se trata de miles o millones de tareas en un sistema!

    La concurrencia es la base para las otras características que mencionamos al inicio: distribución, escalabilidad y tolerancia a fallos. Gracias a la BEAM, se vuelve relativamente fácil implementarla en Elixir y aprovechar las ventajas que nos brinda.

    Ahora, ya conoces más sobre procesos y concurrencia, especialmente sobre la importancia de este aspecto para crear sistemas altamente confiables y tolerantes a fallas. Recuerda practicar y volver a esta nota cuando lo necesites.

    Siguiente capítulo…

    En la siguiente nota hablaremos de las bibliotecas, frameworks y todos los recursos que existen alrededor de Elixir. Te sorprenderá lo fácil y rápido que es crear un proyecto desde cero y verlo funcionando.

    Documentación y Recursos

    Consejero técnico:

    Raúl Chouza

    Corrección de estilo:

    Si tienes dudas acerca de esta nota o te gustaría profundizar en el tema, puedes escribirme por Twitter a @loreniuxmr .

    ¡Nos vemos en el siguiente capítulo!

    The post Entendiendo procesos y concurrencia appeared first on Erlang Solutions .