Synchronous communication between different components on Heroku

I’m creating a chatbot in Java for Slack which looks as follows:

enter image description here

To understand this diagram, think of the “Bot” process as a Slack user that, instead of being a human, is a computer program.

There are two components, the chatbot itself and a syntax parser. The parser takes a long time to start up, so I can’t just launch the parser for each message processed by the the chatbot. Rather the parser must be always running and respond to queries from the chatbot.

I want to deploy all the components to Heroku. As far as I have seen, there are three options to deploy these components:

  1. Bot and parser on the same dyno in the same application
  2. Bot and parser on separate dynos in the same application
  3. Bot and parser in separate applications

The question is how to best achieve a synchronous two-way communication between the two components.

So far I looked at the following possible solutions:

Option 1: bot and parser on same dyno

  • Use named pipes as shown here: this is an error-prone and non-portable solution
  • TCP sockets (set up parser as a server and bot as a client and communicate through localhost and some port): this worked on AWS EC2 (through AWS Elastic Beanstalk), however, it seems to not easily work on Heroku (as discussed here), and I want to migrate from AWS to Heroku

Option 2: bot and parser on different dynos in same application

  • TCP sockets: it’s not a solution here, since processes running on different dynos cannot communicate with each other, as to the documentation here
  • Third-party Heroku messaging and queueing add-on: use one of these add-ons, for example, IronMQ

Option 3: bot and parser in different applications

  • Run parser as a web process and expose a REST interface that the chatbot can access
  • Third-party Heroku messaging and queueing add-on: this should work in the same way as in Option 2

What to do?

I would prefer to decouple the components, so I tend to Option 2 and Option 3.

A message queueing add-on would certainly work, but aren’t they all targeted at asynchronous communication? Because I need only synchronous communication. There’s no gain if the request to the parser returns immediately, because the bot can anyway only reply to a message when the result of the parser is available. So, asynchronous communication might be an overkill here.

Did I miss any possible solution? And what would be robust and efficient architecture for this use case?

On Publishing Itself, Can I automate UnPublishing of Components/Pages based on Metadata

I want to set Expiry Date of Content Items, but I don’t want to use a scheduled core service to check for the expired content periodically because Daily Run of Scheduled service would be overhead on the servers.

Is it possible to schedule UnPublishing of Expired Content items (based on Metadata) on Publishing Itself? (Using Deployer Extension )

How to properly scale Image components to screen percentages?

Let’s take a Sprite. I have two methods for retrieving an orthographic size of the screen:

public static float Width(){
    Camera cam = Camera.main;
    float height = 2f * cam.orthographicSize;
    float width = height * cam.aspect;
    return width;
}

public static float Height(){
    Camera cam = Camera.main;
    float height = 2f * cam.orthographicSize;
    return height;
}

Now, for the Sprite, I have an extension method:

public static void ScreenPercentWidth(this SpriteRenderer renderer, float percent){
    renderer.transform.localScale = new Vector3(
        Screen.Width() / 100f * percent / renderer.sprite.bounds.size.x,
        renderer.transform.localScale.y,
        renderer.transform.localScale.z
    );

}

Which I can use like sprite.ScreenPercentWidth(50f) and it works.

What about a RectTransform/Image? Is there any way that I could create similar methods, so I can scale the Image like in the above example?

Dragging nested components into a diagram in Sparx Enterprise Architect (EA)

In my Enterprise Architect model, I have nodes that contain devices that contain components that contain other components. That’s how I organized the hierarchy in the Project Browser.

I would like to be able to drag one element of the model into a diagram (as a Link), and be able to see all the elements contained by this element without having to drag them individually. For example, dragging a device into a deployment diagram would display the node and all the components it contains.

This logic works when I drag a component onto a diagram: I am able to select what children elements (interfaces, ports, …) I want to see on the diagram. But I did not find a way to do the same with this following containment hierarchy: node > device > component > subcomponent.

Is there a way to do so ?

Thank you 🙂

Impedance matching: Why do components behave totally differently from theory?

I got stuck with impedance matching for an antenna. Any added components in the matching network gave a result totally different from what a Smith chart predicts. Let me explain this clearer.

  1. First, by shortening L2,C8,L5,C23, I measured my antenna “raw” impedance (without matching) at ANT1 terminal (please see attached my matching network). It gave Za_raw = 133 +j 226 (ohm). RF+ is the input feed line of my antenna. There is a SMA connector at ANT1. It connects the rest of my circuit to the antenna.
    matching network

  2. Then, if I replace C23 with an inductor L = 47nH, the measured impedance at ANT1 terminal is 60 + j160 (ohm)!!! But using Smith chart, with Zload = Za_raw, a serial added L of 47nH would give Za = 133 + j 496 (ohm). You can see this in the following figure.
    enter image description here

All measurements were conducted using a VNA. 1-port calibration was done before measuring. Any suggestions are highly appreciated.

****Modified on 17 Oct.**

Here is my construction. I shorten L2, C8, L5 & C23 using wires. The physical length of the feed line is about 29.5mm.

  • The reason for the complicated matching network is that, at first, I would like to make 2 measurement points: at ANT11 and ATN1. ANT1 should be the input impedance of my circuit, while ANT11 should be the antenna input impedance. But later, I thought I don’t need to do that. I just need to tune the input impedance of the whole circuit (with all components soldered) at ANT1 to be 50 ohm!
  • Why 50ohm? In my measurement, at the resonant frequency (around 915 MHz), the impedance at ANT1 is 50ohm!

Am I right?
enter image description here

Using Styled Components, is there a way to select a className

I am using StyledComponents in a React project, and I’m planning to overwriting the styles in Airbnb’s react-dates library. They are using a CSS file with classes, but I want to overwrite their CSS using a wrapper component through StyledComponents (to keep my project consistent with not using CSS files).

Is this possible? I’m not finding anything on it.

Altium: Grouping “Not Fitted” Components In Excel BOM

I would like to include “Not Fitted” components on my Excel BOM exported from Altium. This part is easy, all I need to do is check the “Include Not Fitted Components” box in the “Source Options” panel of the BOM configuration window. However, I would like to modify my Excel template to have a section specifically for “Not Fitted” components, with its own header, and have Altium automatically place the “Not Fitted” components in that section. What would I need to do in my Excel template to accomplish this?

In other words, I need to have Altium look at the “Fitted” column in the BOM and if it sees “Not Fitted” it needs to place these components in a separate section of the BOM (designated by the Excel template).

Shimano BR-R650 long reach calipers compatible with Paul Components Canti Levers?

The Shimano BR-R650 caliper brake uses the Super SLR system. I believe Super SLR relates to the amount of cable pull necessary to activate the brake. Does anyone know if the caliper is compatible with Paul Component’s Canti Levers which are short pull brake levers?