public void TestFeedScheduler() { FeedScheduler.Start("0/5 * * * * ?"); Thread.Sleep(3000000); Assert.IsTrue(true); }
public void Stop() { if (scheduler != null) { scheduler.Stop(); scheduler = null; } }
public override void Stop() { if (scheduler != null) { scheduler.Stop(); scheduler = null; } base.Stop(); }
public void Start(string baseUrl) { baseUrl = IPHelper.FixLocalUrl(baseUrl); app = WebApp.Start <Startup>("http://" + baseUrl); Node = new StandAloneNode(baseUrl); Node.Start(); FeedScheduler.Start(baseUrl, "", null); FeedExtractScheduler.Start(baseUrl); }
public void Start() { Logger.Add(BaseUrl, new List <IAppender> { new RollingFileAppender(BaseUrl), new MemoryAppender(), new ConsoleAppender() }); scheduler = new FeedScheduler(); scheduler.Start(BaseUrl, null); Logger.GetLogger(BaseUrl).Info("Start WebApiServer At http://" + BaseUrl + " with " + NodeType.ToString() + " node"); }
public void SetFeedPage([FromBody] string pages, string baseUrl) { var node = ServerManager.ZkNode(); var path = "/config/feed/" + baseUrl; var data = node.GetData(path); var config = JsonConvert.DeserializeObject <NodeConfig>(data.Data); config.Pages = string.IsNullOrEmpty(pages) ? new int[] { } : pages.Split(',').Select(m => Convert.ToInt32(m)).ToArray(); node.SetData(path, JsonConvert.SerializeObject(config)); var scheduler = FeedScheduler.GetSecheduler(baseUrl); scheduler.SyncFeed(); }
protected override void OnStartup() { base.CreateLiveNode("/live_nodes/feed/" + BaseUrl, null); var stat = zooKeeper.Exists("/config/feed/" + BaseUrl, false); if (stat == null) { var d = new NodeConfig() { Name = BaseUrl, baseUrl = BaseUrl, Proxy = ProxyUrl }; zooKeeper.Create("/config/feed/" + BaseUrl, JsonConvert.SerializeObject(d).GetBytes(), Ids.OPEN_ACL_UNSAFE, CreateMode.Persistent); } FeedScheduler.Start(BaseUrl, ProxyUrl, this); FeedExtractScheduler.Start(BaseUrl); }
protected override void OnStartup() { base.CreateLiveNode("/live_nodes/feed/" + BaseUrl, null); var stat = zooKeeper.existsAsync("/config/feed/" + BaseUrl, false).Result; if (stat == null) { var d = new NodeConfig() { Name = BaseUrl, baseUrl = BaseUrl, Proxy = ProxyUrl }; zooKeeper.createAsync("/config/feed/" + BaseUrl, Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(d)), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); } scheduler = new FeedScheduler(); scheduler.Start(BaseUrl, this); }
public void Change([FromBody] BroadcastEvent @event) { var secheduler = FeedScheduler.GetSecheduler(Request.Host.Value); secheduler.OnReceive(@event); }
public void Change([FromBody] BroadcastEvent @event) { var secheduler = FeedScheduler.GetSecheduler(Request.RequestUri.Authority); secheduler.OnReceive(@event); }