Message-Passing | NAME Message : :Passing - a simple way
kandi X-RAY | Message-Passing Summary
kandi X-RAY | Message-Passing Summary
NAME Message::Passing - a simple way of doing messaging. SYNOPSIS message-pass --input STDIN --output STDOUT {"foo": "bar"} {"foo":"bar"}. DESCRIPTION A library for building high performance, loosely coupled and reliable/resilient applications, structured as small services which communicate over the network by passing messages. BASIC PREMISE You have data for discrete events, represented by a hash (and serialized as JSON). COMPONENTS Below is a non-exhaustive list of components available. INPUTS Inputs receive data from a source (usually a network protocol). FILTER Filters can transform a message in any way. OUTPUTS Outputs send data to somewhere, i.e. they consume messages. SEE ALSO Message::Passing::Manual - The manual (contributions cherished). - Slide deck! Log::Message::Structured - For creating your log messages. Log::Dispatch::Message::Passing - use Message::Passing outputs from Log::Dispatch.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Message-Passing
Message-Passing Key Features
Message-Passing Examples and Code Snippets
Community Discussions
Trending Discussions on Message-Passing
QUESTION
I am running an Argo workflow and getting the following error in the pod's log:
...ANSWER
Answered 2021-Mar-17 at 19:08This happens when you try to see logs for a pod with multiple containers and not specify for what container you want to see the log. Typical command to see logs:
QUESTION
I am using Argo and have a question about the workflow of workflows example. (https://github.com/argoproj/argo-workflows/blob/master/examples/workflow-of-workflows.yaml)
UPDATED YET AGAIN
As pointed out below, it is a task that I need to view. So my question is now - How do I view the logs from a task?
My workflow completes without error, but does not produce the expected output. I would like to look at the logs of one of the containers within one of the workflows within the overall workflow, but I cannot get the syntax right I am using the following convention to get the logs from the relevant pod.
...ANSWER
Answered 2021-Apr-05 at 21:25The default container names on an Argo Workflows pod are init
, main
, and wait
.
I'm not sure what message-passing-1-t8749
refers to, but it might be the "step/task name."
QUESTION
I'm working with dbus in haskell, and I'm having difficulties figuring out how to export dbus methods that perform stateful operations. Below is a fully fleshed out example to illustrate where I'm stuck.
Let's say you're writing a counter service with dbus. When the service starts, the counter is initially at 0. The service defines a dbus API that exposes a count
method, which returns the current value of the counter, and an update
method, which increments that counter, and returns the new value.
Here's a pseudocodey implementation of the behavior I just described, using a message-passing-style of communication:
...ANSWER
Answered 2021-Jan-04 at 18:59Ultimately, the dbus
package only allows you to export
methods of type Method
, which has a methodHandler
field that returns the monadic value:
QUESTION
Suppose I have a bunch of same-origin windows or tabs A, B, C, D, and E, that don't hold references to each other. (e.g. a user opened them independently). Suppose A sends a BroadcastChannel
message to the others, and as a result, D needs to send some data back to A, ideally without involving B, C, or E.
Is this possible, using any of the message-passing APIs?
There's an event.source
property on the broadcast message event, which looked as if it should maybe contain a WindowProxy
or MessagePort
object in this context, but (in my tests with Firefox 78 at least) it was simply null. There's also a ports
array, but that was empty.
...I'm aware that you could start up a SharedWorker to assign each window a unique ID and act as a waystation for passing messages between them, but (a) that seems very complicated for the functionality desired, and (b) every message sent that way is going to need 2 hops, from window to sharedWorker and back to a window, crossing thread boundaries both times, and (usually) getting serialized & unserialized both times as well - even when the two windows share the same javascript thread! So it's not very efficient.
This seems like such an obvious thing to want to do, I'm finding it hard to believe there isn't something obvious I'm missing... but I don't see it, if so!
...ANSWER
Answered 2020-Jul-28 at 23:40Looks like the standards require source
to be null for a BroadcastChannel
. But it shares the MessageEvent interface with several other APIs that do use source
, hence why it exists, but is null.
The postMessage(message) method steps are:
...
5. Remove source from destinations.
Looks like they intentionally kept BroadcastChannel
very lightweight. Just a guess, but the functionality you're looking for might have required additional resources that they didn't want to allocate. This guess is based on a general note they have in the spec:
For elaborate cases, e.g. to manage locking of shared state, to manage synchronization of resources between a server and multiple local clients, to share a WebSocket connection with a remote host, and so forth, shared workers are the most appropriate solution.
For simple cases, though, where a shared worker would be an unreasonable overhead, authors can use the simple channel-based broadcast mechanism described in this section.
QUESTION
I'm working in Fortran 90 with the latest stable version of MPICH (3.3)
I want to have an MPI_Window expose an array on the root process, and all other processes in the communicator call MPI_Get to copy the array into their own "local" copy.
Unfortunately, providing MPI_BOTTOM as the "base" argument in the non-root processes for MPI_Win_create(base, ...) results in the error
MPI_Win_create(192): MPI_Win_create(base=(nil), size=0, disp_unit=1275069467, MPI_INFO_NULL, MPI_COMM_WORLD, win=0x7ffcb343d9fc) failed
MPI_Win_create(156): Null pointer in parameter NULL base pointer is invalid when size is nonzero
I've been working off a textbook example, pg. 61 Fig 3.2, Using Advanced MPI, Modern Features of the Message-Passing Interface, Gropp, Hoefler, Thakur, Lusk.
What is the alternative kind(MPI_ADDRESS_KIND)
that I'm supposed to use besides MPI_BOTTOM
? Is this the correct way to initialize an MPI_Window on a process which isn't actually exposing it's internal memory, just accessing that of another process?
Obviously, changing the argument for base to an already allocated (non-null) array works, but this changes the behavior of the later GET so it doesn't work (creates an invalid memory access).
I don't know why the runtime error specifically says that a null base pointer is invalid with nonzero size, since I'm clearly specifying the size as 0 in the call to mpi_win_create(MPI_BOTTOM, 0, MPI_INTEGER, ...)
.
Here's all the code I have for this example for myself. It sets up the buffers and attempts to create the windows for each process. There is a commented out section between two calls to MPI_Fence
that is the section where all non-root processes attempt the GET.
ANSWER
Answered 2019-Aug-15 at 06:47The size
argument of MPI_Win_create()
has type INTEGER(KIND=MPI_ADDRESS_KIND)
.
I was then able to successfully run the modified version with both MPICH 3.3 and the latest Open MPI
QUESTION
I am trying to test a code from MPI shared memory example from stackoverflow (MPI-3 Shared Memory for Array Struct). Here I will post the whole code for as a minimum reproducible example.
...ANSWER
Answered 2019-Jul-08 at 13:47@Zulan is right about that mpif.h is for fortran. So cannot include mpif.h.
The problem seems like to be the MS MPI version program. I upgrade MS MPI SDK from 9.0 to 10.0 (https://www.microsoft.com/en-us/download/details.aspx?id=57467) and the problem is solved.
QUESTION
I'm having difficulty with a particularly spooky-looking TensorFlow issue. (TensorFlow 1.4.1 and Python 2.7)
ErrorsI'm seeing a couple different errors when running the same program. Here is an example of one:
...ANSWER
Answered 2018-Apr-11 at 18:06My issue ended up being that I was passing indices to tf.gather() that were larger than the size of the tensor I was trying to gather from (the hood_indices within the energy function). I'm not exactly sure how that led to the errors I was seeing, but it fixed my problem.
QUESTION
I am writing a GUI application using the Immediate Mode GUI pattern, and the UI runs on a thread separate to the engine that powers the actual functionality of the application. The GUI thread ends up iterating over many lists of objects that are conceptually "owned" by the engine thread, and these lists change extremely infrequently. The GUI thread is vsync'ed, meaning it runs at about 60Hz, and the engine thread runs at about 200Hz.
Sometimes, actions in the UI will change the contents of the collections in the engine, and I have a message-passing system to post Runnables to the engine thread to do these mutations to ensure that these mutations don't collide with what's happening in the engine. That way, I can ensure that the engine always sees a consistent view of the data, which for my application is very important.
Because the engine is in charge of all data mutations, though, it sometimes happens that the engine changes the contents of a collection while the GUI is iterating through it, and because these collections are standard Java collections, this predictably and correctly throws a ConcurrentModificationException
. I can think of a few high-level ways to deal with this:
- locking, either by using a synchronized collection or read-write locks
- double-buffer the data that the GUI thread reads, and have the GUI thread flip the double-buffer when it's done drawing a frame
- ignore the CME and abort drawing the rest of the frame, which will draw partial information for the frame in which the "bad" mutation happens, and just continue on to the next frame
Locking comes with a significant performance penalty, and while it would be fine for the GUI to sometimes stall while waiting to acquire the lock from the engine thread, it is very important for the engine thread to run at a consistent speed, and even an R/W lock would cause stalls in the engine thread. Double-buffering comes with significant complexity, as there is a lot of data that is read by the GUI on each frame.
I give you all of this background because I know that option 3 is ugly, and that my question is in some sense "not the right question". The Javadoc for ConcurrentModificationException
even says:
Note that fail-fast behavior cannot be guaranteed as it is, generally speaking, impossible to make any hard guarantees in the presence of unsynchronized concurrent modification. Fail-fast operations throw ConcurrentModificationException on a best-effort basis. Therefore, it would be wrong to write a program that depended on this exception for its correctness: ConcurrentModificationException should be used only to detect bugs.
But! I am not concerned with the correctness of the GUI for the single frame that would be marred by the CME. I am only concerned with what happens on the next frame. Which leads to my question: is it safe to continue using a Java collection (I'm most interested in the answer for ArrayList
and HashMap
) after a ConcurrentModificationException
has been thrown from its iterator? It seems logical that it would be, but I can't find a piece of documentation that says that the object will still be in a usable state after the CME is thrown. Obviously the iterator is toast at that point, but I'd like to swallow the exception and continue using the collection.
ANSWER
Answered 2019-Mar-21 at 18:25Quoting part of the quote:
Therefore, it would be wrong to write a program that depended on this exception for its correctness: ConcurrentModificationException should be used only to detect bugs.
Conclusion: Your code is buggy and needs to be fixed, so it doesn't matter what state the collection is in.
You should never get that error in valid code. It's an exception that should never be caught and acted on.
QUESTION
I am currently attempting to create a message-passing library, and one of the tenets of message-passing is that mutable state is only modified through messages. The 'messages' that will be passed around are function objects that take a 'sender' (that created the message) and a 'receiver' (the worker/actor/what have you processing the message from it's queue.)
Workers are defined as follows, and the self-referential nature of the interface is used because a worker may have state that it wants to expose to message senders, and this requires a sender to be aware of it's unique type.
...ANSWER
Answered 2018-Sep-06 at 08:18I don't quite understand your design. What exactly is the purpose of the recursive generics in the interface definitions such as interface Worker>
? Wouldn't interface Worker
suffice, still allowing for the implementation of T getWorker()
to get the concrete type of the class that implements the Worker
interface? Is it an attempt to restrict the interface implementation from returning something that is not a Worker
from getWorker()
? In that case, I think interface Worker>
would create less confusion.
Therefore, how can I ensure that
sender
won't be modified except in the context of a message addressed specifically to it?
To the best of my knowledge, the only way to prevent invocation of an object's methods outside a desired context is to confine the execution of the object's methods to a single thread that is inaccessible to client code. That would require the object to check the current thread as the very first thing in every single method. Below is a simple example. It is essentially a standard producer/consumer implementation in which the object that is being modified (not the Mailbox
/the consumer implementation!) prevents modifications of itself on threads other than a designated thread (the one that consumes the incoming messages).
QUESTION
So in Ada programming language a rendezvous is a method of inter-process synchronization/message-passing. How do I implement this mechanism in java (along with task suspending and selective wait)? I was looking at java's remote method invocation and Exchanger class but I'm yet to find a suitable solution.
...ANSWER
Answered 2017-Dec-15 at 15:32Not familiar with ada but a quick google on ada rendezvous suggests you may be looking for one of the BlockingQueue implementations, possibly SynchronousQueue.
Perhaps if you describe what you want to happen when a message is passed we could help more.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Message-Passing
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page