Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Robert Currey 7 posts 37 karma points
    Aug 10, 2009 @ 16:10
    Robert Currey
    0

    Implementing async behaviour

    Could members of the forum offer suggestions on how to implement a spooler?

    The requirement is to post to a large number of users, too many to wait for completion.

    The list of users would need to be spooled to a persistent data store and a thread would need to consume each member of this list.

    1) What would be the most appropriate way of storing a reference list in umbraco? Custom tree?

    2) Is there service/event to be hooked into to achieve an unattended consume of the list? Could it recover from a server reboot to continue where left off?

    Cheers

    Robert

  • Chris Koiak 700 posts 2626 karma points
    Aug 10, 2009 @ 17:07
    Chris Koiak
    0

    Hi Robert,

    Welcome to the forum and Umbraco.

    Within Umbraco you can setup ScheduledTasks; these tasks are basically calls to a url at a set time. They are defined in config/scheduledtask.config

    <scheduledTasks>
        <!-- add tasks that should be called with an interval (seconds) -->
        <task log="true" alias="test60" interval="120" url="http://localhost/umbraco/plugins/whatever.aspx"/>
      </scheduledTasks>

    You could create a task that checks to see if csv/xml file of members has been uploaded and adds each user to the data store. You would create a variable in the Application state that is updated with the current member import id.

    To recover from a server reboot you may need to store this state to the filesystem or update a field on an Umbraco page (i.e. store it in the DB).

    Personally I'd create a Thread and store a reference to it in Application.Context. The thread will then continue to run as long as the Application is alive.

    HTH

    Chris

  • Robert Currey 7 posts 37 karma points
    Aug 11, 2009 @ 10:54
    Robert Currey
    0

    Thank you, its good to be here.

    In the case of a consumer task your suggestion would lead me to a scheduled 'watcher' event which could launch a thread to consume anything remaining in the spool; good advice.

    Is an umbraco page the only option for data storage in umbraco? In this case the spool wouldn't contain anything but black box data and a document appearing in the ui would be redundant.

    Robert

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Aug 11, 2009 @ 11:10
    Dirk De Grave
    0

    Robert,

    Data can be stored anywhere, so custom tables to store your black box data would do fine. Custom task takes care of reading/update data from the db and do whatever it has to do with it.

     

    Cheers,

    /Dirk

     

  • Chris Koiak 700 posts 2626 karma points
    Aug 11, 2009 @ 12:10
    Chris Koiak
    100

    Dirk's right, you can store data in custom tables, xml, basically anything you can do with .NET.

    Storing data in a node may seem redundant, but it's a quick (and dirty?) way of acheiving what you're after. 

    You can 'hide' the node from your clients using the settings in the User section, so no one needs to know it's there.

Please Sign in or register to post replies

Write your reply to:

Draft