<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by _not_a_robot on Medium]]></title>
        <description><![CDATA[Stories by _not_a_robot on Medium]]></description>
        <link>https://medium.com/@_not_a_robot?source=rss-a92d871881f8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*gu_iIIqeqWB0ou6q.</url>
            <title>Stories by _not_a_robot on Medium</title>
            <link>https://medium.com/@_not_a_robot?source=rss-a92d871881f8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 10:13:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@_not_a_robot/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Sticky sessions with Envoy proxy]]></title>
            <link>https://medium.com/@_not_a_robot/sticky-sessions-with-envoy-proxy-78b02114d54d?source=rss-a92d871881f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/78b02114d54d</guid>
            <category><![CDATA[envoy-proxy]]></category>
            <category><![CDATA[sticky-session]]></category>
            <category><![CDATA[session-affinity]]></category>
            <category><![CDATA[istio-service-mesh]]></category>
            <category><![CDATA[routing]]></category>
            <dc:creator><![CDATA[_not_a_robot]]></dc:creator>
            <pubDate>Tue, 04 Apr 2023 10:23:38 GMT</pubDate>
            <atom:updated>2023-04-04T10:23:38.572Z</atom:updated>
            <content:encoded><![CDATA[<p>Stateful apps require sessions to be sticky to backend pods. This is a very common requirement. This article explores various options Envoy supports to build sticky session support. Let’s dive right in.</p><p>Note: This list is based on my experience and might not be exhaustive.</p><p>Envoy provides a bunch of options for sticky session routing.</p><h4>1. Soft session affinity:</h4><p>Soft session affinity means that stickiness will be maintained as long as the pods are up and running.</p><p>When one of the backend pods restart, the hash ring get rebuilt and all the existing sessions are rerouted. This is a <em>huge downside</em> of soft session affinity and most of the times apps are not-ok with this behaviour.</p><p>a. Header hash based:</p><p>b. Cookie hash based:</p><h4>2. Hard session affinity:</h4><p>Envoy also provides something called as a session filter. Session filter allows <strong>podIP based routing</strong> which means it is not ring based and hence is not affected by sibling pod restarts. In case a podIP is not valid anymore (pod restarted), the request is routed based on default lb_policy and the client gets assigned to a new pod.</p><p>Session filter needs to be added before the http.router sub-filter of httpConnectionManager filter and can be configured with either of the below two options:</p><p><strong>a. Session cookie:</strong></p><p>For browser to service calls, we can configure a cookie based session management. The podIP is written in a cookie and session stickiness to that podIP is maintained as long as the corresponding pod is up and cookie doesn’t expire.</p><p><strong>b. Session header:</strong></p><p>There are situations when cookie based approach isn’t ideal, for eg. service to service calls. For such cases, we can configure a header to carry session information.</p><p>This needs a cooperative client as reading and passing the header between different calls becomes client’s responsibility. Envoy will simply take the podIP from the said header’s value and try to route to that IP.</p><p>Note: This article is still WIP. I am going agile with this one. Adding bits and pieces as and when I get time. Please feel free to comment what you would like added sooner.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78b02114d54d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multiple canvases with Paper.js]]></title>
            <link>https://medium.com/@_not_a_robot/multiple-canvases-with-paperjs-5601b1e78057?source=rss-a92d871881f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/5601b1e78057</guid>
            <category><![CDATA[paperjs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[scopes]]></category>
            <category><![CDATA[canvas]]></category>
            <category><![CDATA[multiple]]></category>
            <dc:creator><![CDATA[_not_a_robot]]></dc:creator>
            <pubDate>Tue, 09 May 2017 16:46:14 GMT</pubDate>
            <atom:updated>2020-02-04T10:29:23.088Z</atom:updated>
            <content:encoded><![CDATA[<p>I got a chance to use Paper.js to create a collaborative whiteboard. It had to be a tabbed interface and had to have an ability to allow multiple people to work simultaneously.</p><p>Although the use-case was such that the same tab will be active at every users end, I wanted the ability for multiple people to work on different boards.</p><p><strong>The problem:</strong></p><p>Paperjs allows only one project to be active at a time. Let me try to explain this with an example:</p><p>Say we have a workspace prototype which we will instantiate per tab.</p><blockquote>/* Say this is our workspace prototype */</blockquote><blockquote>function Workspace ($anchor, info) {</blockquote><blockquote>this.scope = new paper.PaperScope ();</blockquote><blockquote>var $canvas = $anchor.find (‘.canvas’);</blockquote><blockquote>this.scope.setup ($canvas[0]);</blockquote><blockquote>return this;</blockquote><blockquote>}</blockquote><blockquote>Workspace.prototype.draw_path = function (info) {</blockquote><blockquote>var path = this.scope.Path (/* info.things */);</blockquote><blockquote>paper.view.update ();</blockquote><blockquote>}</blockquote><blockquote>/*</blockquote><blockquote>* Used as below */</blockquote><blockquote>var tabs = {};</blockquote><blockquote>// On new tab</blockquote><blockquote>tabs [unique_id] = new Workspace (/* anchors and stuff */);</blockquote><p>Now say we have two tabs:</p><blockquote>tabs [id1].scope.activate (); // Activated the first project</blockquote><blockquote>tabs [id1].draw_path (); // ← Gets drawn on canvas-1, so far so good!</blockquote><blockquote>tabs [id2].draw_path (); // ← Gets drawn on canvas-1 AGAIN, not what we expected.</blockquote><p>And there I was searching through the internet to find a way to support editing multiple tabs at a time.</p><p>I was unable to find something useful (maybe my search query was not good) so I put it on the back burner for a while.</p><p>Then one day I was browsing through paperjs Issues on github when I came across <a href="https://github.com/paperjs/paper.js/issues/677">issue-677</a> .</p><p>It seems there is a way, you might have been using tab2.scope.Path but it won’t use canvas2 unless you manually point the global paper object to the scope you want to use i.e. “window.paper = tab2.scope”.</p><p>So changing path creation to something like below would work.</p><blockquote>Workspace.prototype.draw_path = function (info) {</blockquote><blockquote><strong>window.paper = this.scope;</strong> // This takes care of global paper object</blockquote><blockquote>var path = this.scope.Path (/* info.things */);</blockquote><blockquote>paper.view.update ();</blockquote><blockquote>}</blockquote><p>You may ask me things about paperjs and I will try to answer the best I can.</p><p>Cheers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5601b1e78057" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>