class TodoRepositoryImpl implements TodoRepository {

    @Override
    public Observable<Todo> createOrUpdate(Todo todo) {
        return Observable.create(new Observable.OnSubscribe<Todo>() {
            @Override
            public void call(Subscriber<? super Todo> subscriber) {
                try {
                    long id = todo.save();
                    if (id == -1L) throw new Exception(mContext.getString(R.string.problem_save));
                    subscriber.onNext(todo);
                    subscriber.onCompleted();
                } catch (Exception ex) {
                    subscriber.onError(ex);
                }
            }
        });
    }

    public  TodoRepositoryImpl(Context context);

}