randy schmidt r38y / [email protected]

Upload: api-26204578

Post on 30-May-2018

238 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 Randy Schmidt r38y / [email protected]

    1/15

    Randy Schmidt

    r38y / [email protected], January 12, 2010

  • 8/14/2019 Randy Schmidt r38y / [email protected]

    2/15

    Lose the weight or lose your money

    282.2 lb 262.0 lb10 weeksTuesday, January 12, 2010

  • 8/14/2019 Randy Schmidt r38y / [email protected]

    3/15

    MESSAGES

    Tuesday, January 12, 2010

  • 8/14/2019 Randy Schmidt r38y / [email protected]

    4/15

    Email

    SMSTwitter(More?)

    Tuesday, January 12, 2010

  • 8/14/2019 Randy Schmidt r38y / [email protected]

    5/15

    User Action, Part 1

    New User - email to admin + user

    New Purchase - email to admin + user

    Activate Phone - SMS to users phone

    Friend Request - email to friend

    Friend Response - email to user

    Weighed in - email to user and friends, tweet

    Tuesday, January 12, 2010

  • 8/14/2019 Randy Schmidt r38y / [email protected]

    6/15

    User Action, Part 2

    New Comment - email to user

    Plan Complete - email to user and admin

    Plan Details Confirmed - email to admin

    Purchase Refunded - email to user

    Purchase Cancelled - email to user

    Tuesday, January 12, 2010

  • 8/14/2019 Randy Schmidt r38y / [email protected]

    7/15

    Scheduled Messages

    Daily Reminders - email or SMS to user

    Weigh-in Deadline Reminder - email orSMS to user, email to friends

    Skipped Weigh-in Alert - email to user andfriends, tweet

    Tuesday, January 12, 2010

  • 8/14/2019 Randy Schmidt r38y / [email protected]

    8/15

    LoseItDispatcher

    Handles logic for who gets what when and

    through what medium

    Queues message for deliver in Delayed Job

    Hopefully makes it easier to maintain andadd more mediums

    Tuesday, January 12, 2010

  • 8/14/2019 Randy Schmidt r38y / [email protected]

    9/15

    ScheduledMessage

    DailyReminder - every day, random time

    WeighInReminder - start of weigh-in

    window

    WeighInDeadlineReminder - 6 hours beforeend of weigh-in window

    SkippedWeighInAlert - end of weigh-inwindow *will also be used to mark plan complete (ScheduledAction?)

    Pre-generated records on first weigh in

    Tuesday, January 12, 2010

  • 8/14/2019 Randy Schmidt r38y / [email protected]

    10/15

    SM Daemon

    Acts as a faux-user

    Infinite loop (with 60 second sleep)

    Finds SM with a deliver_at in the past

    Calls deliver! on them

    Each subclass of ScheduledMessageimplements deliver!

    Tuesday, January 12, 2010

  • 8/14/2019 Randy Schmidt r38y / [email protected]

    11/15

    Delayed Job

    Everything that can fail gets queued in DJ tobe processed

    Its good at handling failures

    Meant for doing work

    Tuesday, January 12, 2010

  • 8/14/2019 Randy Schmidt r38y / [email protected]

    12/15

    2 Daemons? Huh?

    One for scheduling for delivery

    One for doing delivery

    SM does a few quick actions (write a fewrows in the DB)

    DJ labors through them

    Did not want to schedule future jobs inorder to keep table clean - work queuesshould try to stay at 0

    Tuesday, January 12, 2010

  • 8/14/2019 Randy Schmidt r38y / [email protected]

    13/15

    Future Changes

    ScheduledMessage => ScheduledAction

    deliver! => perform! - we will be doingmore than sending messages

    LoseItDispatcher should have 1 method

    per action by user or SA

    All message code in LoseItDispatcher

    Tuesday, January 12, 2010

  • 8/14/2019 Randy Schmidt r38y / [email protected]

    14/15

    Other

    TwitterNotifier & SmsNotifier

    Mimic ActionMailer API

    TwitterNotifier.deliver_something(yeah)

    Makes it easy to see what is going on

    Tuesday, January 12, 2010

  • 8/14/2019 Randy Schmidt r38y / [email protected]

    15/15

    Suggestions?

    Questions?T d J 12 2010