event-driven-design

How can I handle all my errors/messages in one place on an Asp.Net page?

℡╲_俬逩灬. 提交于 2019-12-10 11:34:04
问题 I'm looking for some guidance here. On my site I put things in Web user controls. For example, I will have a NewsItem Control, an Article Control, a ContactForm control. These will appear in various places on my site. What I'm looking for is a way for these controls to pass messages up to the Page that they exist on. I don't want to tightly couple them, so I think I will have to do this with Events/Delegates. I'm a little unclear as to how I would implement this, though. A couple of examples:

How can I handle all my errors/messages in one place on an Asp.Net page?

烂漫一生 提交于 2019-12-06 05:40:40
I'm looking for some guidance here. On my site I put things in Web user controls. For example, I will have a NewsItem Control, an Article Control, a ContactForm control. These will appear in various places on my site. What I'm looking for is a way for these controls to pass messages up to the Page that they exist on. I don't want to tightly couple them, so I think I will have to do this with Events/Delegates. I'm a little unclear as to how I would implement this, though. A couple of examples: 1 A contact form is submitted. After it's submitted, instead of replacing itself with a "Your mail has

jQuery plugin for Event Driven Architecture?

时光总嘲笑我的痴心妄想 提交于 2019-12-03 02:54:18
问题 Are there any Event Driven Architecture jQuery plugins? Step 1: Subscribing The subscribers subscribe to the event handler in the middle, and pass in a callback method, as well as the name of the event they are listening for... i.e. The two green subscribers will be listening for p0 events. And the blue subscriber will be listening for p1 events. Step 2: The p0 event is fired by another component to the Event Handler A p0 event is fired to the Event Handler The event handler notifies it's

What kind of “EventBus” to use in Spring? Built-in, Reactor, Akka?

ε祈祈猫儿з 提交于 2019-12-03 00:53:39
问题 We're going to start a new Spring 4 application in a few weeks. And we'd like to use some event-driven architecture. This year I read here and there about "Reactor" and while looking for it on the web, I stumbled upon "Akka". So for now we have 3 choices: Spring's ApplicationEvent : http://docs.spring.io/spring/docs/4.0.0.RELEASE/javadoc-api/org/springframework/context/ApplicationEvent.html Reactor : https://github.com/reactor/reactor#reactor Akka : http://akka.io/ I couldn't find a real

jQuery plugin for Event Driven Architecture?

老子叫甜甜 提交于 2019-12-02 16:45:59
Are there any Event Driven Architecture jQuery plugins? Step 1: Subscribing The subscribers subscribe to the event handler in the middle, and pass in a callback method, as well as the name of the event they are listening for... i.e. The two green subscribers will be listening for p0 events. And the blue subscriber will be listening for p1 events. Step 2: The p0 event is fired by another component to the Event Handler A p0 event is fired to the Event Handler The event handler notifies it's subscribers of the event, calling the callback methods they specified when they subscribed in Step 1:

Unity GUI Button - Polling Input VS Event Driven Input

大城市里の小女人 提交于 2019-12-02 11:29:05
I am learning Unity with C# and studying the GUI Button. I found the following statement in Unity documentation: "This means that your OnGUI implementation might be called several times per frame (one call per event). " using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void OnGUI() { if (GUI.Button(new Rect(10, 10, 150, 100), "I am a button")) print("You clicked the button!"); } } My questions are: 1) The above "if" statement will keep detecting the condition until it is true. It should be called polling input. Why does the above code use polling input

How does event-driven programming help a webserver that only does IO?

删除回忆录丶 提交于 2019-12-02 08:30:31
问题 I'm considering a few frameworks/programming methods for our new backend project. It regards a BackendForFrontend implementation, which aggregates downstream services. For simplicity, these are the steps it goes trough: Request comes into the webserver Webserver makes downstream request Downstream request returns result Webserver returns request How is event-driven programming better than "regular" thread-per-request handling? Some websites try to explain, and it often comes down to something

for loop over event driven code?

℡╲_俬逩灬. 提交于 2019-12-02 05:45:02
问题 In a redis datastore I have a list of keys, I want to iterate over that list of keys and get those values from redis. The catch is I am using an event driven language, javascript via node.js If javascript were procedural I could do this function getAll(callback) { var list = redis.lrange(lrange('mykey', 0, -1); for ( var i = 0; i < list.length; i+= 1 ) { list[i] = redis.hgetall(list[i]); } callback(list); } But, I cannot, therefor.. I do this? function getAll(callback) { redis.lrange('mykey',

for loop over event driven code?

微笑、不失礼 提交于 2019-12-02 02:41:13
In a redis datastore I have a list of keys, I want to iterate over that list of keys and get those values from redis. The catch is I am using an event driven language, javascript via node.js If javascript were procedural I could do this function getAll(callback) { var list = redis.lrange(lrange('mykey', 0, -1); for ( var i = 0; i < list.length; i+= 1 ) { list[i] = redis.hgetall(list[i]); } callback(list); } But, I cannot, therefor.. I do this? function getAll(callback) { redis.lrange('mykey', 0, -1, function(err, reply) { // convert reply into messages var list = []; var index = -1; var

Turn-based Game Design: Event-Driven vs. Game Loop

梦想的初衷 提交于 2019-11-30 13:26:49
问题 I am creating my first game in Java. The game is Monopoly. I am struggling with how I should design the game to model its turn-based structure (managing player turns). I want to allow for both a single human-controlled and one or multiple AI-controlled players to play the game. My specific issue is that I do not know whether to implement a game loop or not, meaning a loop which can manage the players and the variables directly related to the game of Monopoly, (think of things such as