In Solr, is it possible to create a HTTP trigger listener that triggers after a delta import has been completed? - solr

I have come across the solr.httpTriggerListener in the SolrCloud documentation, which can be used to deliver a templated payload to a given url with information about autoscaling.
Is it possible to utilise something similar in order to create a trigger which sends an http request based on the state or activity of data imports?
Specifically, I am looking to create a trigger which is triggered when a delta query has finished completing.
The current implementation I am using in order get this state, is by polling dataimport?command=status, and then interpreting the results. It would be preferable to be able to implement an event listener that awaits a solr trigger, if that is possible.

Related

I want to show real time data fetched by the REST api on the Frontend of the application

I have a list of transactions that are generated in seconds, I am using a wrapper to get these transactions so I made a rest api to get the transactions according to the no. But in the mean time the transaction will get generated more so how do I show the recent on as they generate continuously .
I want to create a Block Explorer on the private Ethereum blockchain using node.js as backend and angular.js as frontend.
You could use here Websockets.
For example Socket.io - https://github.com/socketio/socket.io
Here is Socket.io compoenent for Angular: https://github.com/btford/angular-socket-io
So when your transactions are generated, you will send Push message to client, and client will update it's transaction list.
Possibly the most common approach here, id you have control of contract mods, is to include event emitters for every important state change. This exposes your contract transactions in a detailed (even indexable) and inexpensive way.
On the client, you can use event watchers. This are easily configured with AngularJS. When events arrive, they invoke callbacks. You can do what you need to support the UI or offchain storage in the callback.
For example, you can append a row to an array in to Angular's view model. Angular does a good jub of updating the view when the data in the model as changed. So, a live updated display of transaction events as they arrive is quite feasible and not especially difficult.
Hope it helps.

Slick after commit hook

is it possible to register tasks after a successful slick transaction? I don't want to duplicate this code to every possible endpoint of the transaction. (Like Hibernate afterTransactionCompletion)
Not part of the API. You may be able to get the desired behavior by overriding something in your Slick Driver. Consider opening a ticket at slick/slick

How to set callbacks for updating FullCalendar Event objects in backend

I'd like to add MongoDB / CouchDB as a backend for Fullcalendar. However I need to know when the event has been changed on the client side so I can trigger an update in the backend. Likewise I would need to set a delete callback that would be triggered once the event object was deleted on the client side.
Should the changes fail to propagate to the backend (connection or concurrency issues), the client side should revert to the oldest change saved in the backend.
From what I see about the updateEvent function it's at the view/GUI level and it's about updating/redrawing the View corresponding to the event. Can you please confirm this as well?
UPDATE: In essence I would like to add support in FullCalendar for object collections, collections such as those found in BackboneJS or AngularJS libraries.

How can I refresh a window based on the message sent by an observer subject?

I implemented the observer design pattern in my application, but my app sends to an remote server requests via http protocol that take some time to resolve.
So, naturally, I did the sending an receiving part in a separate thread.
Can you please tell me how to make an window that observes the RequestObject to modify it's state based on the state of the request?
In the debugger step by step mode the window runes the code that I want it to do, but the window never refreshes its self.
Since I don't have a sample of your code I don't know the exacts of how you are updating your UI. If you are attempting to update the UI in the seperate thread that could be your issue. This may be of some help. http://msdn.microsoft.com/en-us/magazine/cc188732.aspx
You may also consider using the Task Parellel Library to perform your asyc operations.
http://msdn.microsoft.com/en-us/library/dd997423.aspx

Periodically Updating Backbone JS Model

I'm using backbone js with an xml api data feed. I have a top-level model for each page that receives the xml and converts it into json. I then have additional methods in the model that return specific parts of the json model to the specific views through a controller. This is all working as expected.
I would like to periodically (via setTimeout) update the top-level model and have it fire the change event and update the views. My question is where I should handle/initialize the firing of this periodic event to update the model since it's not really a user trigger event?
I'd give my model a startUpdate() method, an endUpdate() method, and an internal onTimerUpdate() method that did a fetch. You can then call, on the model, the startUpdate() and let it run as needed, pausing it when it would be inconvenient for a server-side update to run (say, in the middle of a customer manipulation of the data), and restarting it after a client-side change had successfully completed a write to the server.
Better yet, you could make it a mixin and use it with a number of different models.

Resources