Results 1 to 9 of 9

Thread: Priority task

Hybrid View

  1. #1
    Senior Member
    Join Date
    Oct 2009
    Location
    cbba
    Posts
    33

    Priority task

    hi all, i hope you can help me.
    i have my Java Adapter and all works fine, but now i need to implement task with priority.
    ie, i need to tell to Java adapter there are some task that must be executed before other.
    is there any way to do this??

    thank you for your help.
    Naitsir

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    The concept of "task" cannot be easily related with Lightstreamer Data Adapter interface.
    May you please clarify your goals?

    Do you mean that some invocations to update or smartUpdate performed by your Data Adapter should be processed by the Server with priority?

    Or do you mean that each invocation of subscribe towards the Data Adapter should indicate a priority level to be obeyed by the Data Adapter when processing the involved item?

    Do you need to implement a priority mechanism inside your Data Adapter code and are you just asking for suggestions? In this case, I can only warn you that making use in your Data Adapter of the Thread.setPriority feature offered by java might cause side effects on the behavior of the Server kernel, that would need to be validated.

  3. #3
    Senior Member
    Join Date
    Oct 2009
    Location
    cbba
    Posts
    33
    thanks for your reply DarioCrivelli.

    this is the situation (sorry for my english)

    1st problem
    a user subscribes to LS (Lightstreamer). then my Javaadapter has an infinite loop querying the database for updates on multiple tables. but this is not optimal, it query to the database unnecessarily, so i need i way to perform this query to the database only if some value in the database was changed.
    2nd problem
    assuming that there is a way of saying to LS that queries the database. i need to put priority consultation on some tables, because these tables has more important data.

    i hope you can understood me
    Naitsir

  4. #4
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    hello naitsir,

    a user subscribes to LS (Lightstreamer). then my Javaadapter has an infinite loop querying the database for updates on multiple tables. but this is not optimal, it query to the database unnecessarily, so i need i way to perform this query to the database only if some value in the database was changed.
    this depends on your DB, if it has a way to notify you that something has changed than you may just wait for such notifications and only then query it.
    Otherwise keep in mind that an infinite strict loop is always a bad idea (even if, having a blocking call to query the DB you'll not have a proper strict loop unless the network is down and the connection to the db fails immediately)

    assuming that there is a way of saying to LS that queries the database. i need to put priority consultation on some tables, because these tables has more important data.
    there is no such direct way, you'll have to implement your own data adapter and query the db yourself. That said the logic is completely in your hands so that you may query more often important tables and less the others.


    HTH

  5. #5
    Senior Member
    Join Date
    Oct 2009
    Location
    cbba
    Posts
    33
    thanks for your reply Mone,


    a user subscribes to LS (Lightstreamer). then my Javaadapter has an infinite loop querying the database for updates on multiple tables. but this is not optimal, it query to the database unnecessarily, so i need i way to perform this query to the database only if some value in the database was changed.
    this depends on your DB, if it has a way to notify you that something has changed than you may just wait for such notifications and only then query it.
    Otherwise keep in mind that an infinite strict loop is always a bad idea (even if, having a blocking call to query the DB you'll not have a proper strict loop unless the network is down and the connection to the db fails immediately)
    i agree with you, that is why i seek another solution to an infinite loop.

    i not quite understand your reply, how can DB tell to my JavaAdapter that some tables has new data?? (that is the question). is That what you propose??

    thanks again for your answer.
    Naitsir

  6. #6
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    well, I'm not an expert on DBs, so that I can't point you to an actual implementation, btw I imagine that as a DB (or a cluster of DBs) knows whenever something changed on its tables, than maybe there are some implementations able to notify a listener every time this happens. I'm just guessing, you should do some research on this.

 

 

Similar Threads

  1. Message in browser task bar
    By finodex in forum Client SDKs
    Replies: 1
    Last Post: June 6th, 2012, 11:32 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 04:32 PM.