venediktov / vanilla-rtb

Real Time Bidding (RTB) - Demand Side Platform framework

Home Page:http://forkbid.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

simplify bidder assembly process

venediktov opened this issue · comments

It looks like coding a new bidder not based on Geo model we provided in examples requires quite few lines of code.
the pattern we observed is the following - output from one matcher becomes input to the next in the chain.

Following needs to be implemented to simplify bidder assembly process:

  • Create chained_slector to delegate output from previous matcher to the next in the chain
  • Create generic version of bidder cache loader "GenericBidderCacheLoader" capable of loading all matchers data
  • Same GenericBidderCacheLoader should be utilized to retrieve matched data from caches
template<typename Entity, typename ...Entities>
    struct GenericBidderCacheLoader<Entity, Entities ...> : GenericBidderCacheLoader<Entities ...>
  • Simplify the use of bidder as following
.auction_async([&](const BidRequest &request) {
            thread_local vanilla::Bidder<DSLT, Selector> bidder(std::move(Selector()));
            return bidder.bid(request,
                              std::make_tuple(
                                  request.site.get().ref,
                                  retrieve_referer_f,
                                  retrieve_ico_campaign_f,
                                  retrieve_campaign_ads_f
                              )
            );
        });

If following implemented then this code

std::make_tuple(
      request.site.get().ref,
      retrieve_referer_f,
      retrieve_ico_campaign_f,
      retrieve_campaign_ads_f
)

Can be easily generated based on data model provided by DSP.