-
-
Save eiriktsarpalis/e477b8c9602769c34d0f to your computer and use it in GitHub Desktop.
Still unable to reproduce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#I "bin/Debug" | |
#r "FsPickler.dll" | |
#r "HouseHunter.exe" | |
open System.Threading | |
open System.IO | |
open Nessos.FsPickler | |
open HouseHunter | |
let cts = new System.Threading.CancellationTokenSource() | |
let crawler = new Crawler((fun _ -> async.Zero()), ignore, [ Zoopla.T() ]) | |
Async.Start(crawler.Crawl(0m, 100000m, 0, 100), cancellationToken = cts.Token) | |
// wait until data is collected | |
do cts.Cancel() | |
// just a property that publishes the current crawler state | |
let state = crawler.State | |
let fsp = new FsPickler() | |
let file = __SOURCE_DIRECTORY__ + "/bin/Debug/foo.bin" | |
using (File.OpenWrite file) (fun fs -> fsp.Serialize(fs, state)) | |
let data = using (File.OpenRead file) (fun fs -> fsp.Deserialize<Map<string, Property>>(fs)) | |
data = state // true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment