local Rx = require 'Rx'

local AnonymousObservable = Rx.AnonymousObservable
local SchedulerArgument = Rx.internals.SchedulerArgument

--------------------------------------------------------------------------------

return function(scheduler)

    scheduler = SchedulerArgument.validateWithDefault('Rx.Observable.empty',
                                                      'currentThread', scheduler)

    return AnonymousObservable(function(observer)

        return scheduler:schedule(function()

            observer:onCompleted()

        end)

    end)

end
