<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dmitry Maslyukov</title>
    <description>The latest articles on DEV Community by Dmitry Maslyukov (@web_develop_).</description>
    <link>https://dev.to/web_develop_</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F335386%2F312f51ed-efe3-4841-a26a-c7458b419d9e.jpg</url>
      <title>DEV Community: Dmitry Maslyukov</title>
      <link>https://dev.to/web_develop_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/web_develop_"/>
    <language>en</language>
    <item>
      <title>I have created yet another cache go library</title>
      <dc:creator>Dmitry Maslyukov</dc:creator>
      <pubDate>Mon, 04 May 2026 13:52:36 +0000</pubDate>
      <link>https://dev.to/web_develop_/i-have-created-yet-another-cache-go-library-1l4d</link>
      <guid>https://dev.to/web_develop_/i-have-created-yet-another-cache-go-library-1l4d</guid>
      <description>&lt;p&gt;I have recently been frustrated by one thing: there is practically no library for caching &lt;strong&gt;singleton&lt;/strong&gt; values.&lt;/p&gt;

&lt;p&gt;The thing is most caches are designed to keep a lot of things in one caching container.&lt;/p&gt;

&lt;p&gt;What if I did not need the key-value generic map? &lt;br&gt;
So on one hand there was complexity and generic implementations of caching with ttl, but nevertheless well-maintained, but on the other hand there were no solutions for caching singletons.&lt;/p&gt;

&lt;p&gt;So I have decided to create one myself. This was not very painful, but I feel strange that practically no-one has done this before.&lt;/p&gt;

&lt;p&gt;Sincerely, I am writing this post in a thought that someone comes across it and has same demand.&lt;/p&gt;

&lt;p&gt;I will be happy to get someone's day easier. Do not spend AI tokens for this boilerplate, just download it.&lt;/p&gt;

&lt;p&gt;The license is MIT, so you can use, fork or do whatever you want in any kind of product.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/maslyukov0" rel="noopener noreferrer"&gt;
        maslyukov0
      &lt;/a&gt; / &lt;a href="https://github.com/maslyukov0/single_value_cache" rel="noopener noreferrer"&gt;
        single_value_cache
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Blazingly fast library that allows safe singleton caches. Built with generics and type safety
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Single Value Cache&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;This is a tiny, focused Go library designed for those moments when you need to cache just &lt;em&gt;one&lt;/em&gt; thing the best way, that cache libraries do not provide.&lt;/p&gt;
&lt;p&gt;Whether it's a configuration object, a token, or a result from a heavy database query, this library helps you handle it without the boilerplate of a full-blown key-value store.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Why use this?&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Caching can be tricky. You often have to deal with:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Race conditions:&lt;/strong&gt; Multiple goroutines trying to update the same value.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Thundering herds:&lt;/strong&gt; A sudden spike in requests when the cache expires, all hitting your database at once.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Type safety:&lt;/strong&gt; Casting &lt;code&gt;any&lt;/code&gt; back and forth.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This library solves these problems by combining &lt;strong&gt;Generics&lt;/strong&gt;, &lt;strong&gt;TTL (Time-To-Live)&lt;/strong&gt;, and &lt;strong&gt;Singleflight&lt;/strong&gt; protection in a simple, human-friendly package.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Features&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Type Safe:&lt;/strong&gt; Built with Go Generics, so no more type assertions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Smart Loading:&lt;/strong&gt; Using &lt;code&gt;golang.org/x/sync/singleflight&lt;/code&gt;, it ensures that even if 100…&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/maslyukov0/single_value_cache" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;
&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;your_best_program&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="s"&gt;"github.com/maslyukov0/single_value_cache"&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;loadData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctx&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;select&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;After&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Minute&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="m"&gt;42&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Done&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;errors&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;New&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"my most liked error"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;cache&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cache&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;NewSingleValueCache&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Hour&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;loadData&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="c"&gt;// It will propagate context.Cancelled or any other error from    your loader&lt;/span&gt;
    &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;cache&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Background&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Value = %v, error = %v&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, it is simple as hell.&lt;/p&gt;

&lt;p&gt;I have already got it into action into product I am building: there is a domain access whitelist and it works fine.&lt;/p&gt;

&lt;p&gt;Also feel free to open an issue or comment a question.&lt;/p&gt;

&lt;p&gt;Happy developing day!&lt;/p&gt;

</description>
      <category>go</category>
      <category>cache</category>
    </item>
    <item>
      <title>Looking for developers</title>
      <dc:creator>Dmitry Maslyukov</dc:creator>
      <pubDate>Thu, 13 Feb 2020 21:30:50 +0000</pubDate>
      <link>https://dev.to/web_develop_/looking-for-developers-2199</link>
      <guid>https://dev.to/web_develop_/looking-for-developers-2199</guid>
      <description>&lt;p&gt;I'm looking for people to contribute to open-source project Dulang programming language. &lt;a href="https://github.com/Orfund/dulang" rel="noopener noreferrer"&gt;https://github.com/Orfund/dulang&lt;/a&gt;&lt;br&gt;
It's written in C-99 so low-level developers (and documentation writers) mostly wanted.&lt;br&gt;
Please contact me on:&lt;br&gt;
Twitter: &lt;a class="mentioned-user" href="https://dev.to/web_develop_"&gt;@web_develop_&lt;/a&gt;&lt;br&gt;
VK: @deemazs&lt;br&gt;
Email: &lt;a href="mailto:cendleader@gmail.com"&gt;cendleader@gmail.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Or write comments here. I rely on your activity&lt;/p&gt;

</description>
      <category>c</category>
      <category>python</category>
      <category>contributorswanted</category>
    </item>
    <item>
      <title>Dulang performance</title>
      <dc:creator>Dmitry Maslyukov</dc:creator>
      <pubDate>Thu, 13 Feb 2020 20:22:58 +0000</pubDate>
      <link>https://dev.to/web_develop_/dulang-performance-42ha</link>
      <guid>https://dev.to/web_develop_/dulang-performance-42ha</guid>
      <description>&lt;p&gt;consider following data: small benchmark comparing three dynamically typed programming languages: python, JS and Dulang. Bigger is better.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpbs.twimg.com%2Fmedia%2FEQrmH7XW4AADoeY%3Fformat%3Djpg%26name%3D4096x4096" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpbs.twimg.com%2Fmedia%2FEQrmH7XW4AADoeY%3Fformat%3Djpg%26name%3D4096x4096" width="2336" height="1632"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
